File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes JDBC 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


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "servlets and JDBC on tomcat 5.5" Watch "servlets and JDBC on tomcat 5.5" New topic
Author

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
Marshal

Joined: Jan 10, 2002
Posts: 60048
    
  65

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

Moved to the JDBC forum.


[Asking smart questions] [Bear's FrontMan] [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

Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
Connection c = DriverManager.getConnection("Jdbc:Odbc:MyDB");
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: servlets and JDBC on tomcat 5.5
 
Similar Threads
Hibernate 2.1 and Oracle 9.2.0.4 connection
Unable to Access the Database
Tomcat 5.5 and simple JDBC program issue
Resource element in Tomcat 5.5 -- help needed
Cannot create JDBC driver of class 'oracle.jdbc.OracleDriver'for connect URL 'jdbc:oracle:oci:@mydbs