aspose file tools*
The moose likes JDBC and the fly likes Utility to check open DB connection ? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "Utility to check open DB connection ?" Watch "Utility to check open DB connection ?" New topic
Author

Utility to check open DB connection ?

Karn Kumar
Ranch Hand

Joined: Aug 06, 2009
Posts: 143

Hi All ,


In the project say somewhere connection is not closed .

So is there is anything(any utility , api or something) in Java to check the Java Class where we have open DB connection ?


Thanks in advance ..


- Chetan

T Mishra
Ranch Hand

Joined: Apr 04, 2006
Posts: 107

If you deploy your application on JBoss and you've missed to close connection during a unit of work that involves transaction, then JBoss sends a warning message to close the connection.

Otherwise, you can check it using Connection.isClosed()


Thanks,
Tushar (SCJP 1.5)
Karn Kumar
Ranch Hand

Joined: Aug 06, 2009
Posts: 143

Thanks Tushar , for your reply..

Yeah i can use isClosed() method to check if connection is closed or not , but i want some functionality or some tool which will tell me exact class where i missed closing connection in live application.

T Mishra
Ranch Hand

Joined: Apr 04, 2006
Posts: 107

I'm not aware of / used such tools. Perhaps an expert advice is needed here. What I think of is to write a method in the transaction layer as a checkpoint.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Utility to check open DB connection ?
 
Similar Threads
database access
open database connection
DB Connection Question for MySQL
@PersistenceContext Injection in SessionBeans
HTTPS Cipher Threshold