Win a copy of Node.js Design Patterns: Design and implement production-grade Node.js applications using proven patterns and techniques this week in the Server-Side JavaScript and NodeJS forum!
  • 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
  • Ron McLeod
  • Rob Spoor
  • Tim Cooke
  • Junilu Lacar
Sheriffs:
  • Henry Wong
  • Liutauras Vilda
  • Jeanne Boyarsky
Saloon Keepers:
  • Jesse Silverman
  • Tim Holloway
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Mikalai Zaikin
  • Piet Souris

Enabling Connection pretest in hibernate.cfg.xml

 
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Ranch Hand
Posts: 53
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
can anyone help..?? am here
 
Bartender
Posts: 10336
Hibernate Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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,


 
You showed up just in time for the waffles! And this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
reply
    Bookmark Topic Watch Topic
  • New Topic