File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Oracle/OAS and the fly likes JDBC Usage in OC4J Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » Oracle/OAS
Bookmark "JDBC Usage in OC4J" Watch "JDBC Usage in OC4J" New topic

JDBC Usage in OC4J

Nagaraju Nookala

Joined: Mar 19, 2004
Posts: 23

I am new to Oracle9iAS and OC4J. I created a new instance of OC4J for my application. I modified the datasource configuration to point to my database server which is Oracle 9i.

The details in my Edit Data Source screen of Enterprise Manager Console of OC4J are as below:

Maximum Open Connections 20
Minimum Open Connections 1
(datasource JNDI name, URL, UserName, Password are not shown here)

When I click on the OC4J instance link on the EM Console I am seeing the following information for the JDBC Usage

JDBC Usage

Open JDBC Connections 88
Total JDBC Connections 175
Active Transactions 0
Transaction Commits 0
Transaction Rollbacks 0

Why am I seeing Totla and Open JDBC Connections more than the set value?

I am using the below given code to access the datasource and fetch and manipulate the underlying data through my code:

Are there any connection leaks?


[edited to add code tags]
[ August 18, 2005: Message edited by: Jeanne Boyarsky ]
Jeanne Boyarsky
author & internet detective

Joined: May 26, 2003
Posts: 33117

There isn't a connection leak, but there is a resource leak. You need to close the resultset, then the statement and then the connection. The lower level objects are no longer accessible to be closed after you close the connection.

[OCA 8 book] [Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Other Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, TOGAF part 1 and part 2
I agree. Here's the link:
subject: JDBC Usage in OC4J
It's not a secret anymore!