aspose file tools*
The moose likes Object Relational Mapping and the fly likes Error ##### org.hibernate.exception.GenericJDBCException: Cannot open connection Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » Object Relational Mapping
Bookmark "Error ##### org.hibernate.exception.GenericJDBCException: Cannot open connection" Watch "Error ##### org.hibernate.exception.GenericJDBCException: Cannot open connection" New topic
Author

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

Vinod Vinu
Ranch Hand

Joined: Aug 30, 2009
Posts: 217
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


Vinod Kumar Nair
"Any fool can write code that a computer can understan. Good programmers write code that humans can understand."
Vitaliy Kravchenko
Greenhorn

Joined: Dec 02, 2010
Posts: 10
May be your mySQL Server is off? check this
jdbc:mysql://localhost:3306/vinod
Vinod Vinu
Ranch Hand

Joined: Aug 30, 2009
Posts: 217
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

Joined: Dec 02, 2010
Posts: 10
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

Joined: Aug 30, 2009
Posts: 217
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.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Error ##### org.hibernate.exception.GenericJDBCException: Cannot open connection