Results 1 to 4 of 4
Thread: JDBC Connection...
- 08-21-2009, 08:22 AM #1
Member
- Join Date
- Aug 2009
- Posts
- 2
- Rep Power
- 0
- 08-21-2009, 10:03 AM #2
Hi,
You can use a method for creating the connection as well as for statement object.U can resuse it .After using ,make sure to close statement,ResultSet and connection to avoid memory leaks.
-Regards
RamyaRamya:cool:
- 08-21-2009, 11:16 AM #3
Member
- Join Date
- Aug 2009
- Posts
- 2
- Rep Power
- 0
thanks for your reply....
i wanna know should i call that method again and again to create Connection/Statement objects ... of should i call that once when user login and close that Connection when log off...?
- 08-21-2009, 11:34 AM #4
Ur code flow will be like this.Connection should not be created and closed multiple times.Declare the Connection object globally open once and close once.
1. Open the Connection for ex: using openConnection() method
2. Do database operations
3. Close the connection for ex: using closeConnection() methodRamya:cool:
Similar Threads
-
Help me this error in JDBC-ODBC connection
By lordelf in forum Java ServletReplies: 3Last Post: 04-04-2009, 08:37 AM -
Problem in jdbc connection with servlets
By illusion1912 in forum Java ServletReplies: 0Last Post: 01-06-2009, 07:34 PM -
jdbc connection problem
By Assaf A in forum JDBCReplies: 0Last Post: 12-01-2008, 05:08 PM -
JDBC connection
By Java Tip in forum Java TipReplies: 0Last Post: 11-10-2007, 07:39 PM -
How to close JDBC Connection
By Heather in forum JDBCReplies: 2Last Post: 07-15-2007, 01:07 PM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks