• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

org.hibernate.exception.JDBCConnectionException: Cannot open connection

 
vamsi naki
Ranch Hand
Posts: 61
  • Mark post as helpful
  • send pies
  • 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
 
Carles Gasques
Ranch Hand
Posts: 199
1
  • Mark post as helpful
  • send pies
  • 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
  • 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
  • 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
  • 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
  • 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
  • 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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic