Hi List,
this is my first post to this list.
I am developing a webapp that runs in a Tomcat (4.1.24) and uses MySQL as
the underlying RDBMS. Not knowing then what I do know now, I implemented a
class to represent a queries ResultSet by storing that ResultSet and writing
methods to access, update and insert data to the set and the database. I
completely neglected the number of connections available :(
I am now struggling to implement some connection pooling without having to
change all the rest of the code and was pointed to
sun.jdbc.rowSet.CachedRowSet. I believe that this would be the easiest
approach to adapting my code. I have been able to get queries to work in a
matter of hours but seem to be stuck now with updates and inserts. My
connection-pool is setup in my server.xml (snipplet below) but when calling
crs.acceptChanges() I get a "java.sql.SQLException: Unable to get
Connection". I have tried to manually get a connection from the pool and
pass it to the method resulting in a "java.sql.SQLException: writeData
cannot determine the table name." error :(
Has anyone made use of the CachedRowSet with MySQL and could give me a tip
as to what I am doing wrong or missing?
Thanks, Jan
[snipp]
<ResourceParams name="jdbc/BankDB">
<parameter>
<name>factory</name>
<value>org.apache.commons.dbcp.BasicDataSourceFactory</value>
</parameter>
<parameter>
<name>maxActive</name>
<value>100</value>
</parameter>
<parameter>
<name>removeAbandoned</name>
<value>false</value>
</parameter>
<parameter>
<name>maxIdle</name>
<value>30</value>
</parameter>
<parameter>
<name>maxWait</name>
<value>10000</value>
</parameter>
<parameter>
<name>username</name>
<value>application</value>
</parameter>
<parameter>
<name>password</name>
<value>*******</value>
</parameter>
<parameter>
<name>driverClassName</name>
<value>org.gjt.mm.mysql.Driver</value>
</parameter>
<parameter>
<name>url</name>
<value>jdbc:mysql://frodo:3306/bank_db?autoReconnect=true</value>
</parameter>
</ResourceParams>
</Context>
[snapp]
| Thread |
|---|
| • sun.jdbc.rowSet.CachedRowSet | dr.ahab | 29 May |