Win a copy of Java Mock Exams (software) this week in the Programmer Certification (OCPJP) forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Getting GenericJDBCException

 
tara krishna
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I am new to this forum . I have implemented small application i.e for retrieving data from the database and displaying data on the console. For this I have implemented one JSF file it containing one button whenever I click on the button it is going to call the controller but the problem is whenever I am clicking on button my controller was calling but it is giving an error i.e.

org.hibernate.exception.GenericJDBCException: Cannot open connection

can any one tell me how to resolve this problem?

Regards
Sumanth
 
Paul Sturrock
Bartender
Posts: 10336
Eclipse IDE Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hibernate can't open a connection to your database. Check you DataSource configuration - is it correct?
 
tara krishna
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
where I have to datasource name in case of hibernate.
 
tara krishna
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sorry that was grammar mistake i.e where I have to check my datasource name in case of hibernate.
 
Travis Hein
Ranch Hand
Posts: 161
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
if you are building a console (stand alone) application, one way to configure hibernate is in the hibernate configuration xml file.

that is the hibernate.cfg.xml file at the top of your classpath.

if you are using hibernate 3, here is a link to the configuration reference to set up the datasource in the hibernate.cfg.xml.
http://www.hibernate.org/hib_docs/v3/reference/en/html/tutorial.html#tutorial-firstapp-configuration
 
What are you doing? You are supposed to be reading this tiny ad!
the new thread boost feature brings a LOT of attention to your favorite threads
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!