Mukul Kapur

Greenhorn
+ Follow
since Jun 21, 2009
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Mukul Kapur

Hi friends..This is my first post...I am a newbie Java Developer..Okay Here goes
I have just made a LAN based Java application using Swing,JDBC with backend as MS-Access..The backend is on a shared network drive..
The application is distributed as jar files on the LAN PCs..
Everywhere I have connected to the database I have just closed the connection explicitly like this
con.close();
I do not close the associated resultset and statement explicitly

The specification says associated statements and resultsets close when you close
the connection,even if you don't explicitly close them
Also I am not using connection pool..its simple basic connection using DriverManager

Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
String url = "jdbc:odbc:DSN name";
String user = "";
String pw = "";
con = DriverManager.getConnection(url, user, pw);
Statement stmt = con.createStatement();
String select = "" ;
ResultSet rows = stmt.executeQuery(select);

Till now no performance problems..over 4K records have been added..
JVM is not exiting or anything..
On the net everyone says to explicitly close everything..but I did not know that
earlier..

My question is
Is closing just the connection enough..?
Is there any way I can check whether statements and resultsets have been implicitly closed?
Later on will it cause any performance problems or anything...?
Shud I change my code and add rs.close() and stmt.close() everywhere..?

If specification says everything closes on
closing connection why do ppl insist on closing everything explicitly..?
Or is this driver dependent..don't the drivers go through the specification..
My driver is the Sun JDBC ODBC bridge.....

There would be 8-10 users maximum at a time using the application concurrently...

Any help would be appreciated..Thanks in advance..