wood burning stoves 2.0*
The moose likes JDBC and the fly likes Help! DriverManager.getConnection problem Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "Help! DriverManager.getConnection problem" Watch "Help! DriverManager.getConnection problem" New topic
Author

Help! DriverManager.getConnection problem

raj guntupalli
Greenhorn

Joined: Dec 16, 2002
Posts: 27
When I to connect to a access databse with a jdbc-odbc bridge it connects fine and everything works out.But when I try to connect the same database from the servlet in my tomacat4.0 DriverManager.getConnection("jdbcdbcD","",""); is not working.Can anyone please help me.bye.
[ December 19, 2002: Message edited by: Thomas Paul ]
Gregg Bolinger
GenRocket Founder
Ranch Hand

Joined: Jul 11, 2001
Posts: 15299
    
    6

What is not working? What error message(s) are you getting?


GenRocket - Experts at Building Test Data
raj guntupalli
Greenhorn

Joined: Dec 16, 2002
Posts: 27
java.sql.SQLException
Cobras9
Greenhorn

Joined: Dec 20, 2002
Posts: 3
add the username and password in the last 2 block of apostrophes
coz ur exception is too general and usually this means somehting went wrong in ur sql statement or u might be using a null connection to try and set up a statement.....so many causes that can relate to this SQLException
Cobras9
Greenhorn

Joined: Dec 20, 2002
Posts: 3
oh i think in tomcat , when u r getting a connection using DriverManager, u suppose to supplie an URL.....something like
"jdbc:informix-sqli://%dbhost%:%portNum/dbname:INFORMIXSERVER=%dbserver%;user=XXXXX;password=XXXXX;"
try this ....but u have to find out what u have to type in the url coz this is for Informix db
David O'Meara
Rancher

Joined: Mar 06, 2001
Posts: 13459

"Cobras9",
The Java Ranch has thousands of visitors every week, many with surprisingly similar names. To avoid confusion we have a naming convention, described at http://www.javaranch.com/name.jsp.
We require names to have at least two words, separated by a space, and strongly recommend that you use your full real name. Please edit your profile and select a new name which meets the requirements.
Please change your display name soon, accounts with invalid display names get deleted
Thanks.
Dave
David O'Meara
Rancher

Joined: Mar 06, 2001
Posts: 13459

Copied from the duplicate thread
Originally posted by raj guntupalli :
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Help! DriverManager.getConnection problem