Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Error ##### org.hibernate.exception.GenericJDBCException: Cannot open connection

 
Vinod Vinu
Ranch Hand
Posts: 217
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi, i'm getting the following error on eclipse's console:-

%%%% Success Creating SessionFactory %%%%
------HIBERNATE SESSION SUCCESSFULLY READ-------
INSERTING RECORDS
Dec 4, 2010 6:22:11 AM org.hibernate.util.JDBCExceptionReporter logExceptions
WARNING: SQL Error: 0, SQLState: null
Dec 4, 2010 6:22:11 AM org.hibernate.util.JDBCExceptionReporter logExceptions
SEVERE: Communication failure during handshake. Is there a server running on localhost:3306?
Error ##### org.hibernate.exception.GenericJDBCException: Cannot open connection


I'm developing a web application using struts, java, hibernate, tomcat 6 and mysql database.

Hibernate configuration:-


I'm sure that i have given correct database information like its db name, username and password, but don't know what is wrong with it.
Using Navicat i can connect easily with 'vinod' database by providing the same credentials. But why cannot be with hibernate ?
Any idea?

Thanks in advance
 
Vitaliy Kravchenko
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
May be your mySQL Server is off? check this
jdbc:mysql://localhost:3306/vinod
 
Vinod Vinu
Ranch Hand
Posts: 217
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
May be your mySQL Server is off? check this
jdbc:mysql://localhost:3306/vinod


Please explain me how can i check that if my mysql server is running or not ?

thanks
 
Vitaliy Kravchenko
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you have installed mySQL Server as service, check MyComputer -> right click ->control -> and find there Mysql, then check that service is running
Or you can start Client command line, if everything will be ok, then you Server is running
 
Vinod Vinu
Ranch Hand
Posts: 217
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I did it, the only solution i found to be is to remove a mysql jar file named 'mysql-connector-java-2.0.14'

It is working now fine.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic