File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes JDBC and Relational Databases and the fly likes servlets and JDBC on tomcat 5.5 Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » JDBC and Relational Databases
Bookmark "servlets and JDBC on tomcat 5.5" Watch "servlets and JDBC on tomcat 5.5" New topic

servlets and JDBC on tomcat 5.5

Lalit Nagalkar
Ranch Hand

Joined: Aug 22, 2006
Posts: 47
Hello all,

Can anybody tell me which URL should I use while making a connection to database suing DriverManager.getConnection(URL) on a tomcat 5.5 server. I tried unsuccessfully both URLs "jdbc dbc:MyDB" and "jdbc dbc://localhost/MyDB". The driver is sun.jdbc.odbc.JdbcOdbcDriver and DB is MS-Access database.

Thanking all.

SCJP 1.4
Bear Bibeault
Author and ninkuma

Joined: Jan 10, 2002
Posts: 63852

The JDBC URL is independent of whether you are using servlets or Tomat.

Moved to the JDBC forum.

[Asking smart questions] [About Bear] [Books by Bear]
Tim LeMaster
Ranch Hand

Joined: Aug 31, 2006
Posts: 226
jdbcdbc:MyDB looks like a JDBC-ODBC Bridge Driver URL. Did you setup the ODBC connection?

You should also Tell the Details. Post a stack trace. Show actual code snippets.
Poonam Kadu
Ranch Hand

Joined: Jul 21, 2006
Posts: 49
Hi Lalit,
You may try this

Connection c = DriverManager.getConnection("Jdbc:Odbc:MyDB");
I agree. Here's the link:
subject: servlets and JDBC on tomcat 5.5
jQuery in Action, 3rd edition