B
Brzezi
Hi.
I`m programing an application, which uses database (Postgresql), it`s
multithread, there is no problem yet
it`s multithread, so I`v decided to use connection`s pooling, I had been
doing it before end there is no problem too, it works well
but problem appeared because I want to use PreparedStatements to execute
queries
for pooling connections I`m using org.apache.commons.dbcp, in its
configuration (BasicDataSource) is something about pooling prepared
statements, but how to use it?
when I want to gain Connection from pool I do:
dataSource.getConnection()
but how to do it for PreparedStatement, I mean how to gain
PreparedStatement from pool?
is preparedStatement.execute*() doing it itself? and I shouldn`t matter
about it no more?
If it is possible, please for a piece of source/example how I should do
it, because I`v not found anything useful on dbcp project website nor
google :/
Thanks in advance for any helpful idea.
Pozdrawiam
Brzezi
I`m programing an application, which uses database (Postgresql), it`s
multithread, there is no problem yet
it`s multithread, so I`v decided to use connection`s pooling, I had been
doing it before end there is no problem too, it works well
but problem appeared because I want to use PreparedStatements to execute
queries
for pooling connections I`m using org.apache.commons.dbcp, in its
configuration (BasicDataSource) is something about pooling prepared
statements, but how to use it?
when I want to gain Connection from pool I do:
dataSource.getConnection()
but how to do it for PreparedStatement, I mean how to gain
PreparedStatement from pool?
is preparedStatement.execute*() doing it itself? and I shouldn`t matter
about it no more?
If it is possible, please for a piece of source/example how I should do
it, because I`v not found anything useful on dbcp project website nor
google :/
Thanks in advance for any helpful idea.
Pozdrawiam
Brzezi