silviuxa01 de Septiembre del 2005
PreguntaHola:
Tengo un pequeño problema con el ODBC JDBC de access para java: he hecho una mini aplicacion java que incluye jsps, servlets y beans, pero por alguna extraña razon, cuando intento invocar mi clase de conexion a la BD me manda el siguiente error en pantalla:
Excepcion al conectar la base de datos: Can't find resource for bundle java.util.PropertyResourceBundle, key db.driver
esto a pesar de que la conexion esta bien, es decir, los datos que le doy para la conexion:
public class ConectaDB implements HttpSessionBindingListener
{
private static Connection ConexionDB ;
private static ResourceBundle bdProperties;
private static String dbLog;
private static String driver = "sun.jdbc.odbc.JdbcOdbcDriver";
private static String dbURL = "jdbc:odbc:DBRecibos;user=recibos;password=recibos;";
public ConectaDB() throws BdException
{
try
{
bdProperties = ResourceBundle.getBundle("db");
driver=bdProperties.getString("db.driver");
dbURL=bdProperties.getString("db.url");
//System.out.println("Driver " + driver + " URL " + dbURL);
Class.forName(driver);
ConexionDB=DriverManager.getConnection(dbURL);
//dbLog= DriverManager.setLogWriter;
}
catch (ClassNotFoundException e)
{
ConexionDB=null;
throw new BdException(e.getMessage());
}
catch (SQLException e)
{
throw new BdException("Driver no Cargado: " + e.getErrorCode() + e.getMessage() + e.getSQLState());
}
catch (Exception e)
{
throw new BdException("Excepcion al conectar la base de datos: " + e.getMessage());
}
}
Algun consejo, opinion o algo por el estilo?
Gracias!
Tengo un pequeño problema con el ODBC JDBC de access para java: he hecho una mini aplicacion java que incluye jsps, servlets y beans, pero por alguna extraña razon, cuando intento invocar mi clase de conexion a la BD me manda el siguiente error en pantalla:
Excepcion al conectar la base de datos: Can't find resource for bundle java.util.PropertyResourceBundle, key db.driver
esto a pesar de que la conexion esta bien, es decir, los datos que le doy para la conexion:
public class ConectaDB implements HttpSessionBindingListener
{
private static Connection ConexionDB ;
private static ResourceBundle bdProperties;
private static String dbLog;
private static String driver = "sun.jdbc.odbc.JdbcOdbcDriver";
private static String dbURL = "jdbc:odbc:DBRecibos;user=recibos;password=recibos;";
public ConectaDB() throws BdException
{
try
{
bdProperties = ResourceBundle.getBundle("db");
driver=bdProperties.getString("db.driver");
dbURL=bdProperties.getString("db.url");
//System.out.println("Driver " + driver + " URL " + dbURL);
Class.forName(driver);
ConexionDB=DriverManager.getConnection(dbURL);
//dbLog= DriverManager.setLogWriter;
}
catch (ClassNotFoundException e)
{
ConexionDB=null;
throw new BdException(e.getMessage());
}
catch (SQLException e)
{
throw new BdException("Driver no Cargado: " + e.getErrorCode() + e.getMessage() + e.getSQLState());
}
catch (Exception e)
{
throw new BdException("Excepcion al conectar la base de datos: " + e.getMessage());
}
}
Algun consejo, opinion o algo por el estilo?
Gracias!
