473,396 Members | 1,886 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

JDBC connection check

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
1 2044
JosAH
11,448 Expert 8TB
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

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

Similar topics

1
by: Axel Dachtler | last post by:
Hello, my Java-program can't load the JDBC driver. I always get a java.lang.NoClassDefFoundError when I run it. The JDBC Driver is in the directory: C:\programs\ora92\jdbc\lib I think I...
0
by: Nils Valentin | last post by:
Hi MySQL Fans ;-), Is it possible that the 3.08 series allows to connect to 4.0.14 versions but not to the 4.1 alpha-versions ? I get belows error when tryig to connect from DbVisualizer which...
0
by: Robert Mazur | last post by:
MySQL 5.0 alpha (binary install) on Solaris 9 -or- RedHat 8.0 mysql-connector-java-3.0.8-stable ----------------------- Is there something different going on with JDBC and the alpha version...
6
by: Swami | last post by:
Hi, I have installed MQ SQL Server 2000 on my laptop and trying to use SPRINTA 2000 JDBC Driver (inetmssql.jar) to connect to the local db. I wrote a sample Java app to test the connection and I...
3
by: John | last post by:
Hi All I'm new to set up DB2 though using JDBC for years. my question is: supposed there are 3 computers in local-net, named A,B,C (they are Windows 2000 families). DB2 installed in A (port...
6
by: c_piliotis | last post by:
While accessing unicode data, I get a bug check thrown: com.ibm.db2.jcc.a.SqlException at com.ibm.db2.jcc.a.s.a(s.java:1521) at com.ibm.db2.jcc.a.s.n(s.java:532) at...
5
oll3i
by: oll3i | last post by:
my librarybean package library.ejb; import java.sql.*; import javax.ejb.*; import library.common.*; @Stateless @Remote
2
by: bevis | last post by:
I'm new to sql server and mysql but this seems like it should be a pretty straight forward jdbc connection. But I have spent almost 2 days just trying to get a jdbc connection. Please help if you...
1
by: rjha94 | last post by:
Hi Folks we have a java application using hibernate ORM mapper on top of db2 UDB v9. we are using type 4 jdbc drivers for connections. Now the issue is we have a table with BLOB column and ...
3
by: Anoop | last post by:
Is it true that there are no type 4 jdbc drivers to connect to a DB2 server v7.1? The DB2 server is hosted on ACF2 (OS/390). We would be connecting from windows and solaris boxes. If it is true,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.