File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Object Relational Mapping and the fly likes Enabling Connection pretest in hibernate.cfg.xml Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Databases » Object Relational Mapping
Bookmark "Enabling Connection pretest in hibernate.cfg.xml" Watch "Enabling Connection pretest in hibernate.cfg.xml" New topic
Author

Enabling Connection pretest in hibernate.cfg.xml

Prabu Pidaran
Greenhorn

Joined: Feb 22, 2010
Posts: 19
Hi All...

I am using hibernate 3.0. I have created a datasource.... i want to enable the Pretest connection properties through hibernate.cfg.xml. Is it possbile..?? if yes, can someone help how to enable it..? which property i need to add in hibernate.cfg.xml to enable the pretest connection property?

Thanks in advance.
Ravishanker kumar
Ranch Hand

Joined: Jul 20, 2006
Posts: 53
I think you need some server(Jboss, weblogic or any other ) to register datasource, then only you can test datasource configured in hibernate.cfg.xml.
Prabu Pidaran
Greenhorn

Joined: Feb 22, 2010
Posts: 19
Hi Ravi..

I am using Websphere 6.1 and i have created the datasource in the server. But i need to enable the pretest connection property through hibernate.cfg.xml
Prabu Pidaran
Greenhorn

Joined: Feb 22, 2010
Posts: 19
can anyone help..?? am here
Paul Sturrock
Bartender

Joined: Apr 14, 2004
Posts: 10336

I'm not aware of any pretest connection property in Hibernate's configuration. Can you explain what you are asking about?


JavaRanch FAQ HowToAskQuestionsOnJavaRanch
Ravishanker kumar
Ranch Hand

Joined: Jul 20, 2006
Posts: 53
I am not sure whether this is exactly your requirement or not . I am confused with 'Pretest connection'.
According to my understanding you have configured some datasource in hibernate.cfg.xml as below,

Now you want to test this configuration. For this you need to configured datasource on server. For example on jboss we can configure datasource details in some xml file as below

You need to find out same for Websphere .After these configuration when you will start the server and deploy application(which will contains hibernate.cfg.xml file) you can access database connection as below,

or you can get hibernate session as below,


 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Enabling Connection pretest in hibernate.cfg.xml