Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

JDBC connection error

 
kyro gue
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 2588
11
C++ Linux Netbeans IDE
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Print the actual exception message, in stead of your own error text. The exception will tell you what's wrong.
 
kyro gue
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanks resolved. it is correct all along.because i have been using the old class files
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic