aspose file tools*
The moose likes JDBC and the fly likes Draining database resources or not? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » JDBC
Bookmark "Draining database resources or not?" Watch "Draining database resources or not?" New topic
Author

Draining database resources or not?

Dan Parsons
Ranch Hand

Joined: May 30, 2007
Posts: 70
I have Java Servlets and JSP working great with Oracle 9i database using JDBC Thin Driver in our Apache Tomcat Container sitting on Windows 2000 server.

Everytime I go into an Oracle record with my Java front end web page I notice that I am opening a program called JDBC Thin Client.

Basically I am testing it out by opening records in the Front end JSP and then checking in SQL Plus to see what is going on in the database.
I use this command in my SQL Plus tool:
select username, program, status, server from v$session where username = 'jones';

The issue is the JDBC Thin Client Program seems to not disappear even though I am closing my database connections in a Java Finally block.

The below shows the output from the SQL Plus if I open 3 different records (open record, then close the record and then open up another record) in my Java web page.

SQL Plus results using: select username, program, status, server from v$session where username = 'jones';


It shows JDBC Thin Client program running 3 times.
Is the JDBC Thin Client program draining resources from our Oracle 9i database even if the status says inactive? The JDBC Thin Client Programs seem to not go away and was wondering what else I can do to make sure the database connections are closed.

Please advise.
[ May 30, 2007: Message edited by: Dan Parsons ]
Herman Schelti
Ranch Hand

Joined: Jul 17, 2006
Posts: 387
hi Dan,

do you use connection pooling in your application?

Herman
Dan Parsons
Ranch Hand

Joined: May 30, 2007
Posts: 70
It turns out I had two areas I was not closing my Database connections.
I closed them and now everything is okay with no JDBC Thin Client programs showing up.

Do I need a Connection Pool for a Database that is only hit on at most 10 times a day and hardly ever has Concurrent users hitting on it?
Herman Schelti
Ranch Hand

Joined: Jul 17, 2006
Posts: 387
hi Dan,

No, you don't need connection pooling then, but..

even now it already has one big advantage to use connection pooling:
your Java code does not depend on any particular database or driver.
So it's easier to reuse your code for another application without having to change any Java-code.


Herman
Compliments for checking your connections.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: Draining database resources or not?