This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes JDBC and the fly likes database connetion Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "database connetion" Watch "database connetion" New topic
Author

database connetion

nikil shar
Ranch Hand

Joined: May 25, 2008
Posts: 116
hi all,
have a servlet which runs sql against an oracle 11g database with Oracle JDBC driver V9.2.0.1.0. For some reason i keep getting "connection closed" exception even when i detect closed connections in the code (see below) and re-establish a connection.
The app server which i have my connection pool set up in is glassfish V3




any suggestions as to what can be done to ensure a "valid" connection is available before running sql ?? Have tried calling the isValid() but don't think my driver supports it since i get sql exception for this method.

thanks very much.
Misha Ver
Ranch Hand

Joined: Mar 03, 2008
Posts: 470
nikil shar wrote:The app server which i have my connection pool set up in is glassfish V3


Perhaps you could just use "validationQuery" parameter in the connection pool setting
nikil shar
Ranch Hand

Joined: May 25, 2008
Posts: 116
hey that worked. thanks a million !!!
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: database connetion
 
Similar Threads
initialising db connection
prepareStatement problem with the driver classes12.zip
Setting Location for database to be used by javadb
how to show database table with webservice?
how to retrive database table data with webService?