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
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: 60782
    
  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");
 
jQuery in Action, 2nd edition
 
subject: servlets and JDBC on tomcat 5.5
 
Similar Threads
Tomcat 5.5 and simple JDBC program issue
Hibernate 2.1 and Oracle 9.2.0.4 connection
Resource element in Tomcat 5.5 -- help needed
Unable to Access the Database
Cannot create JDBC driver of class 'oracle.jdbc.OracleDriver'for connect URL 'jdbc:oracle:oci:@mydbs