• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Enabling Connection pretest in hibernate.cfg.xml

 
Prabu Pidaran
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 53
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 19
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 19
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
can anyone help..?? am here
 
Paul Sturrock
Bartender
Posts: 10336
Eclipse IDE Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm not aware of any pretest connection property in Hibernate's configuration. Can you explain what you are asking about?
 
Ravishanker kumar
Ranch Hand
Posts: 53
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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,


 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic