By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
443,627 Members | 2,339 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 443,627 IT Pros & Developers. It's quick & easy.

JDBC connection check

P: 9
I am always checking if any of my JDBC has Database leaks with our Oracle 9i database.

Here is what I use in SQL Plus:
Expand|Select|Wrap|Line Numbers
  1. select username, program from v$session where username = 'myUserSchemaName';
If I dont close my connections the above query shows a program running called JDBC Thin Client. If I do alot of JDBC inserts and updates in my Web Application, the query will show many lines of JDBC Thin Client showing up.
When I do close my connections correctly and do alot of inserts and updates in my Web Application, the above query doesnt show any programs running so I assume I dont have any database leaks?

This is my way and would like to know how experienced Java developers check to make sure all their Database connections are closed?
Oct 23 '07 #1
Share this Question
Share on Google+
1 Reply


Expert 10K+
P: 11,448
This is my way and would like to know how experienced Java developers check to make sure all their Database connections are closed?
Use a connection pool and close the open connection in the pool at the end.
The Apache commons project has a few nice connection pools implemented.

kind regards,

Jos
Oct 24 '07 #2

Post your reply

Sign in to post your reply or Sign up for a free account.