File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
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
Author

JDBC Usage in OC4J

Nagaraju Nookala
Greenhorn

Joined: Mar 19, 2004
Posts: 23
Hi,

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?

Thanks,
NN

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

Joined: May 26, 2003
Posts: 29253
    
139

Nagaraju,
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.


[Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Blogging on Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, OCAJP, OCPJP beta, TOGAF part 1 and part 2
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: JDBC Usage in OC4J
 
Similar Threads
Please Help! I Have Worked On IT For Days.
Database access, potential threading problem?
Connection Establishment problem with Oracle
Hibernate Connection Pool
StaleConnectionException