From: Marcos L. <ma...@eu...> - 2003-02-16 21:23:20
|
hi!! i'm new in this list and i have joined it because i have a doubt of mdbtoo= ls using java in linux. I've looking in Internet how to connect to a MS acc= ess database but i can't manage it.=20 i'll explain you what i've done and if you see something wrong correct me = please. here is the code in java which i have used : private void Conectar () //m=E9todo que realiza las conexiones necesarias a la base de datos. //Solo se va a hacer una vez en todo el juego, Connection y Stateme= nt //se van pasando a las demas clases. { try{ Class.forName("sun.jdbc.odbc.JdbcOdbcDriver"); } catch (ClassNotFoundException e1){ System.out.println("Imposible cargar la Base de Datos"); } try { con =3D DriverManager.getConnection("jdbc:odbc:mine","",""); stmt =3D con.createStatement(); }catch (SQLException e1) { System.out.println (e1.getMessage()); } } then in odbc.ini i have put this: [mine] Description =3D mine Driver =3D MDBToolsODBC Database =3D /home/raist/prog/mine.mdb servername =3D localhost UserName =3D Password =3D Port =3D 5432 and in odbcinst.ini : =09 [MDBToolsODBC] Description =3D MDB Tools ODBC drivers Driver =3D /usr/lib/libmdbodbc.so.0 Setup =3D FileUsage =3D 1 CPTimeout =3D CPReuse =3D and finally when i execute it the error is: raist@palanthas:~/prog$ java hola No suitable driver =09 any advice? something wrong? something missing? please reply if you now som= ething. Thank you bye P.D: sorry for my english. I'm spanish and i dont know if i have expressed = myself well.=20 |