Java Forums

Main Menu
Home
Today's Posts
FAQ
Search
Contact Us

Java Network
Linux Archive
Java Tips
Java Tips Blog

Sponsored Links





Welcome to the Java Forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community, you will:

  • have access to post topics
  • communicate privately with other members (PM)
  • not see advertisements between posts
  • have the possibility to earn one of our surprises if you are an active member
  • access many other special features that will be introduced later.

Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact us.

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 06-09-2007, 05:44 AM
Senior Member
 
Join Date: Jun 2007
Posts: 114
Albert is on a distinguished road
Connections to data bases
When we work with connections to data bases and do operations like select, we must generate the following objects:
A Connection, a Statement and a ResultSet.
When finalizing the query one must close the connection and the other objects.
My question is the following one:
the ResultSet object, it is created through Statement object, and this through Connection object, is it enough to close the Connection object?, that is to say, to do a Connection.close(), or is it necessary to close the three objects one by one?

Albert
Bookmark Post in Technorati
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 06-09-2007, 05:50 AM
Senior Member
 
Join Date: Jun 2007
Posts: 111
Eric is on a distinguished road
You have that to close one by one.
The method of the Connection object gives you an object Statement, and the object Statement gives you a Resultset, it does not mean that one “contains” to the others.
They are objects that “live” in independent form, are in different zones from memory, etc, etc, etc.

Eric
Bookmark Post in Technorati
Reply With Quote
Sponsored Links
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to control DataBase connections using Spring framework Java Tip Java Tips 0 04-01-2008 12:44 PM
Export data to xls trill Advanced Java 2 01-11-2008 11:24 AM
Rejecting connections from a specific IP javaplus Networking 2 12-21-2007 04:28 PM
add data into an array mispeed New To Java 9 11-08-2007 05:53 AM
How to control DataBase connections using Spring framework JavaBean Java Tips 0 10-04-2007 11:15 PM


All times are GMT +3. The time now is 02:54 PM.


VBulletin, Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright ©2006 - 2007, www.java-forums.org