Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Access 97 & Tomcat 4.0

 
dodo dimitrius
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi guys,
I have a problem accessing an Access 97 database on the Tomcat 4.0.
The code in the file is:
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
Connection con = DriverManager.getConnection("jdbc dbc://localhost:8080/databasename", "","");
I also tried:
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
Connection con=DriverManager.getConnection("jdbc dbc river={MicroSoft Access Driver (*.mdb)} BQ=//localhost:8080/ databasename");
I used ODBC Data Sources(32bit) to create a data source, pointing to the server directory C:\..\webapps\ROOT\databasename.mdb, where I placed the database.
I start the server, and run the class. Using first option, I get Exception:
Data source name not found and no default driver specified.
Using second option:
Driver keyword syntax error
Questions:
Do I need to create a new data source pointing to the Tomcat subdirectory?
Where do I place the database on the server? In which subdirectory?
Do I need to install Access Driver on Tomcat?
Anyone with an idea?
Thanks,
Berko
 
Bosun Bello
Ranch Hand
Posts: 1511
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The JDBC_ODBC driver should already have come with your installation of the JDK. The database can be abywhere on your server. Yes, you need to create a datasource pointing to wherever the DB is on your server.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic