|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Get inside! Sample the range of functionality easily built with JMSL Library for Time Series Data Analysis, Heat Maps, Portfolio Optimization, Monte Carlo Simulation, Stock Price Charting and more. Download Now! |
|
#1
|
|||
|
|||
|
jdbc connection..
Hi,
a simple question.. I open a connection to a oracle/mysql db. Create a statement Create a ResultSet Execute statement.. execute the Resultset.. DONT close the statement.. DONT close the ResutlSet CLOSE the connection.. Would this automatically close the statement and resultset?? any explanations?? thnx, sgaucho |
|
#2
|
|||
|
|||
|
From the javadoc:
Quote:
That sounds to me like everything gets closed. And I know for a fact that you can't use a ResultSet after the connection has been closed. |
|
#3
|
|||
|
|||
|
Thnx...
but i had read somewhere that not closing the statements would leave open cursors in the database.. isnt it so? My problem is I am opening connections to both Oracle and Mysql Databases and at the end of the script closing the connections to both.. But no matter what I do, I c that the connections are not freed at all.. In one case I open two connections to 2 diff databases in MySQL and in the Mysqlfront I see that about 40 connections are spawned/created and hardly 50 % are closed/freed at the end!!!!! Why does this happen and how do I remedy this?? thnx again, sands |
|
#4
|
|||
|
|||
|
Well, it's possible that java hasn't gotten around to garbage collecting the connections, yet. That seems like it would be horribly innefficient to me, though.
|
![]() |
| Viewing: Dev Shed Forums > Programming Languages > Java Help > jdbc connection.. |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|