• 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

org.hibernate.exception.JDBCConnectionException: Cannot open connection

 
Ranch Hand
Posts: 61
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
I am trying out a sample program from hibernate ,i just copy pasted the files from a tutorial .I created a new database connection for hsqldb and am able to ping successfully to it .I am getting this error when i run my main method

org.hibernate.exception.JDBCConnectionException: Cannot open connection

I made the change in hibernate.cfg.xml file,my console:


Hibernate.cfg.xml file
 
Ranch Hand
Posts: 199
1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

What command do you use to start the database?
 
vamsi naki
Ranch Hand
Posts: 61
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
i used this
java -cp hsqldb.jar org.hsqldb.util.DatabaseManager
 
Carles Gasques
Ranch Hand
Posts: 199
1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

Could you start the database from the DatabaseManager?

Try start the database in server mode
and use the string connection with user = "sa" and password = "".


Best regards,



 
vamsi naki
Ranch Hand
Posts: 61
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am getting this error ,i ran hsqldb in server mode and changed the connection url to what you gave

 
Carles Gasques
Ranch Hand
Posts: 199
1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Well,
now you can connect to the data base, but your user or password are incorrect.
Have you changed the default password for "sa" to "krishna"?

Cheers,
 
vamsi naki
Ranch Hand
Posts: 61
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi ,
when i dont give any password ,it seems to be working although i didnt expect the output to be like this but still its working i guess.Thanks a lot for your help.if you dont mind can i post a doubt or two to you in message .I am new to Hibernate and HSQLDB and i have to figure out somethings,its a bit confusing right now.Once again Thank you very much.
 
reply
    Bookmark Topic Watch Topic
  • New Topic