Re: Opening db connections
- From: Lew <lew@xxxxxxxxxxxxx>
- Date: Tue, 13 Nov 2007 09:31:02 -0500
Lew wrote:
What is StatementProvider?
Eduardo Yáñez Parareda wrote:
I'm sorry, it's a class of my project, I didn't realize of that.
This is what I meant:
Connection conn = .... getConnection...
Statement stmt = conn.getStatement();
ResultSet rs = stmt.executeQuery("select 1");
rs = stmt.executeQuery("select 1");
rs = stmt.executeQuery("select 1");
You have as many connections as conn points to.
<http://java.sun.com/javase/6/docs/api/java/sql/DriverManager.html#getConnection(java.lang.String)>
<http://java.sun.com/javase/6/docs/api/java/sql/Connection.html>
and, of course, the Javadocs for ResultSet and Statement.
BTW, consider using a PreparedStatement instead of a "regular" Statement.
--
Lew
.
- References:
- Opening db connections
- From: Eduardo Yáñez Parareda
- Re: Opening db connections
- From: Lew
- Re: Opening db connections
- From: Eduardo Yáñez Parareda
- Opening db connections
- Prev by Date: Re: What is URL rewriting?
- Next by Date: Re: What is URL rewriting?
- Previous by thread: Re: Opening db connections
- Next by thread: class loader getResourceAsStream
- Index(es):
Relevant Pages
|