From: <d34...@ya...> - 2003-07-28 03:30:39
|
Hi all! I have the following problem: a web application in a Java / Tomcat / Linux environment. This application is feed by .mdb files, weekly. After searching (a lot) on web how I could read these files, I found your project. Howerver, I'm having several doubts in using its odbc features. First I install unixodbc and configure it like this: ODBC.INI: ... [MyDB] Description = MyDB Driver = MDBToolsODBC Database = /home/gsouza/MyDB.mdb Servername = localhost UserName = Password = Port = 5432 ODBCINST.INI: [MDBToolsODBC] Description = MDB Tools ODBC drivers Driver = /usr/local/lib/libmdbodbc.so.0 Setup = FileUsage = 1 CPTimeout = CPReuse = Then, i installed rpms of mdbtools. After that, I did some test using mdb-* utils and It worked ok. Finally, I begun my first java test, using jdbcOdbc bridge, to access the .mdb: import java.sql.*; class TestDB { public static void main (String args[]) { String url = "jdbc:odbc:MyDB"; try { Class.forName("sun.jdbc.odbc.JdbcOdbcDriver"); Connection conn = DriverManager.getConnection (url, "", ""); ......... It compiles without problems, but at runtime it throws a NullPointerException on DriverManager.getConnection method. So I tried the dns-less way, like: String url = "DRIVER={MDB Tools ODBC drivers}; DBQ=/home/gsouza/MyDB.mdb" String url = "DRIVER={MDBToolsODBC}; DBQ=/home/gsouza/MyDB.mdb" String url = "DRIVER={/usr/local/lib/libmdbodbc.so.0}; DBQ=/home/gsouza/MyDB.mdb" Nevertheless, none worked. Thus, if anyone that have been successful in java + mdbtools figure out what I'm doing wrong I'd appreciate. Thank you. P.S.: I'm sorry cause of grammar errors. I'm not an english native speaker. _______________________________________________________________________ Conheça o novo Cadê? - Mais rápido, mais fácil e mais preciso. Toda a web, 42 milhões de páginas brasileiras e nova busca por imagens! http://www.cade.com.br |