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 JDBC connection error 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 "JDBC connection error" Watch "JDBC connection error" New topic
Author

JDBC connection error

kyro gue
Greenhorn

Joined: Jan 05, 2010
Posts: 12
i am doing a project which works in my school , and i have taken the whole project back home to spend more time doing it. however the school lab environment and my home computer is totally different, their settings are set for us such that there is practically nothing for us to configure. i have done my configurations and i reach a error from tomcat : Exception in init(): Unable to establish connection to database 'bus_guide'

this is my servlet file


i have attached a image of my sql client server and tomcat DOS .

kyro gue
Greenhorn

Joined: Jan 05, 2010
Posts: 12
i have connector j downloaded, and renamed and have set my classpath for connector j

CLASSPATH C:\mysqlconnectorj\mysql-connector-java-5.1.13-bin.jar;
Jan Cumps
Bartender

Joined: Dec 20, 2006
Posts: 2497
    
    8

Print the actual exception message, in stead of your own error text. The exception will tell you what's wrong.


OCUP UML fundamental and ITIL foundation
youtube channel
kyro gue
Greenhorn

Joined: Jan 05, 2010
Posts: 12
replaced with e.getMessage(); displayed on tomcat

Communications Link Failure The last packet sent successfully to the server was 0 milliseconds ago. The driver has not received any packets from the server.

i do not know how to write the codes for printing a full stack trace. pardon me
kyro gue
Greenhorn

Joined: Jan 05, 2010
Posts: 12
thanks resolved. it is correct all along.because i have been using the old class files
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: JDBC connection error