• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

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

 
Ranch Hand
Posts: 220
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
May be your mySQL Server is off? check this
jdbc:mysql://localhost:3306/vinod
 
Vinod Vinu
Ranch Hand
Posts: 220
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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: 220
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic