URGENTE! ERROR DE CONEXION

pipo
22 de Junio del 2006
Pues eso, que tengo un error y no puedo conectar con la bd. Tengo añadido el driver al classpath y no se q puede fallar. Os dejo el codigo para q le echeis un vistazo. El error que me da es de "SQLException". Gracias

package proyecto_hotel;

import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
import java.sql.*;


/**
* <p>Título: </p>
* <p>Descripción: </p>
* <p>Copyright: Copyright (c) 2005</p>
* <p>Empresa: </p>
* @author sin atribuir
* @version 1.0
*/

public class nueva_pension extends JFrame {
JLabel jLabel8 = new JLabel();
JLabel jLabel4 = new JLabel();
JLabel jLabel1 = new JLabel();
JButton jButton7 = new JButton();
JLabel jLabel3 = new JLabel();
JLabel jLabel2 = new JLabel();
JLabel jLabel9 = new JLabel();
JButton jButton6 = new JButton();
JButton jButton5 = new JButton();
JLabel jLabel7 = new JLabel();
JTextField jTextField2 = new JTextField();
JLabel jLabel6 = new JLabel();
JTextField jTextField1 = new JTextField();
JTextField jTextField4 = new JTextField();
JLabel jLabel5 = new JLabel();
JComboBox jComboBox1 = new JComboBox();

Connection con; //conexion
Statement stmt; //statement
ResultSet rs;
String miconsulta;
int tipo_pen;
String tpen;
int tipo_p;
JButton jButton1 = new JButton();


public nueva_pension() {

try {

jComboBox1.addItem("Solo alojamiento");
jComboBox1.addItem("Alojamiento y desayuno");
jComboBox1.addItem("Media pensión");
jComboBox1.addItem("Pensión completa");
jComboBox1.setSelectedIndex(3);

jbInit();
}
catch(Exception ex) {
ex.printStackTrace();
}
}

void jbInit() throws Exception {
jLabel5.setBounds(new Rectangle(48, 177, 119, 29));
jLabel5.setText("*");
jLabel5.setFont(new java.awt.Font("Bermuda Solid", 1, 20));
jLabel5.setForeground(Color.red);
jTextField4.setBounds(new Rectangle(241, 144, 70, 21));
jTextField4.setText("");
jTextField4.setHorizontalAlignment(SwingConstants.RIGHT);
jTextField4.setCaretPosition(0);
jTextField4.setEditable(false);
jTextField4.setBorder(BorderFactory.createRaisedBevelBorder());
jTextField4.setBackground(SystemColor.info);
jTextField4.setEnabled(true);
jTextField1.setBackground(SystemColor.info);
jTextField1.setBorder(BorderFactory.createRaisedBevelBorder());
jTextField1.setCaretPosition(0);
jTextField1.setText("");
jTextField1.setHorizontalAlignment(SwingConstants.RIGHT);
jTextField1.setBounds(new Rectangle(241, 80, 68, 21));
jTextField1.addFocusListener(new nueva_pension_jTextField1_focusAdapter(this));
jLabel6.setBounds(new Rectangle(65, 113, 160, 21));
jLabel6.setText("TIPO");
jLabel6.setBorder(BorderFactory.createEtchedBorder());
jLabel6.setFont(new java.awt.Font("Garamond", 1, 13));
jLabel6.setForeground(Color.black);
jTextField2.setBounds(new Rectangle(241, 177, 181, 72));
jTextField2.setText("");
jTextField2.setCaretPosition(0);
jTextField2.setEditable(false);
jTextField2.setBorder(BorderFactory.createRaisedBevelBorder());
jTextField2.setBackground(SystemColor.info);
jTextField2.setEnabled(true);
jLabel7.setBounds(new Rectangle(48, 113, 119, 29));
jLabel7.setText("*");
jLabel7.setFont(new java.awt.Font("Bermuda Solid", 1, 20));
jLabel7.setForeground(Color.red);
jButton5.setText("NUEVA");
jButton5.addActionListener(new nueva_pension_jButton5_actionAdapter(this));
jButton5.setBounds(new Rectangle(71, 298, 91, 32));
jButton5.setEnabled(false);
jButton5.setBorder(null);
jButton6.setBounds(new Rectangle(295, 298, 112, 32));
jButton6.setEnabled(false);
jButton6.setBorder(null);
jButton6.setText("LIMPIAR DATOS");
jButton6.addActionListener(new nueva_pension_jButton6_actionAdapter(this));
jLabel9.setBounds(new Rectangle(48, 136, 119, 29));
jLabel9.setText("*");
jLabel9.setFont(new java.awt.Font("Bermuda Solid", 1, 20));
jLabel9.setForeground(Color.red);
jLabel2.setFont(new java.awt.Font("Garamond", 1, 13));
jLabel2.setForeground(Color.black);
jLabel2.setBorder(BorderFactory.createEtchedBorder());
jLabel2.setText("Nº PENSIÓN");
jLabel2.setBounds(new Rectangle(65, 80, 160, 21));
jLabel3.setFont(new java.awt.Font("Bermuda Solid", 1, 20));
jLabel3.setForeground(Color.red);
jLabel3.setText("*");
jLabel3.setBounds(new Rectangle(49, 80, 119, 29));
jButton7.setBounds(new Rectangle(181, 361, 93, 32));
jButton7.setEnabled(false);
jButton7.setBorder(null);
jButton7.setText("SALIR");
jButton7.addActionListener(new nueva_pension_jButton7_actionAdapter(this));
jLabel1.setBackground(Color.white);
jLabel1.setFont(new java.awt.Font("Georgia", 3, 20));
jLabel1.setForeground(Color.red);
jLabel1.setBorder(BorderFactory.createRaisedBevelBorder());
jLabel1.setText(" PENSIONES");
jLabel1.setBounds(new Rectangle(160, 15, 145, 38));
jLabel4.setBounds(new Rectangle(65, 177, 160, 21));
jLabel4.setText("DESCRIPCIÓN");
jLabel4.setBorder(BorderFactory.createEtchedBorder());
jLabel4.setRequestFocusEnabled(true);
jLabel4.setFont(new java.awt.Font("Garamond", 1, 13));
jLabel4.setForeground(Color.black);
jLabel8.setBounds(new Rectangle(65, 144, 160, 21));
jLabel8.setText("% PRECIO HABITACIÓN");
jLabel8.setBorder(BorderFactory.createEtchedBorder());
jLabel8.setFont(new java.awt.Font("Garamond", 1, 13));
jLabel8.setForeground(Color.black);
this.getContentPane().setLayout(null);
jComboBox1.setBackground(SystemColor.info);
jComboBox1.setEnabled(false);
jComboBox1.setBorder(BorderFactory.createRaisedBevelBorder());
jComboBox1.setBounds(new Rectangle(241, 113, 182, 22));
jButton1.setBounds(new Rectangle(181, 298, 93, 32));
jButton1.setEnabled(false);
jButton1.setBorder(null);
jButton1.setText("MODIFICAR");
jButton1.addActionListener(new nueva_pension_jButton1_actionAdapter(this));
this.setTitle("* * * HOTEL ABADES FUENSANTA * * * -> PENSIONES");
this.getContentPane().add(jTextField1, null);
this.getContentPane().add(jTextField4, null);
this.getContentPane().add(jTextField2, null);
this.getContentPane().add(jComboBox1, null);
this.getContentPane().add(jLabel1, null);
this.getContentPane().add(jButton5, null);
this.getContentPane().add(jButton1, null);
this.getContentPane().add(jButton6, null);
this.getContentPane().add(jButton7, null);
this.getContentPane().add(jLabel3, null);
this.getContentPane().add(jLabel2, null);
this.getContentPane().add(jLabel7, null);
this.getContentPane().add(jLabel8, null);
this.getContentPane().add(jLabel9, null);
this.getContentPane().add(jLabel6, null);
this.getContentPane().add(jLabel4, null);
this.getContentPane().add(jLabel5, null);

con = abreConexion("oracle.jdbc.driver.OracleDriver","jdbc:oracle:[email protected]:XE","abades","clave");

}

public Connection abreConexion(String driver,String servidor,String usuario, String clave) {
try{
Class.forName(driver);

//Busca el controlador y abre conexion
return DriverManager.getConnection(servidor,usuario,clave);
}
catch(ClassNotFoundException e) {
System.out.println("No se han podido cargar los controladores");
return null;
}
catch(SQLException e){
System.out.println("No se ha podido acceder a la base de datos");
return null;
}
}