Hello,
I have a few questions about DBTags:
1) I open a connection and close a connection in each jsp that accesses the
database
I'm using the latest mysql JDBC driver.... is there connection pooling built
in in that driver or not ?
2) I have tried to use DBTags and Poolman together but it didn't work... Did
someone already do this and what were the results.
this is in my web.xml :
<context-param>
<param-name>dbURL</param-name>
<param-value>jdbc:poolman://dancevibes</param-value>
<description>
Which Database to access and where it is located
</description>
</context-param>
<context-param>
<param-name>mysqlDriver</param-name>
<param-value>com.codestudio.sql.PoolMan</param-value>
<description>
JDBC Driver
</description>
</context-param>
<context-param>
<param-name>dbUserId</param-name>
<param-value>mysql</param-value>
<description>
DB user id
</description>
</context-param>
<context-param>
<param-name>dbPassword</param-name>
<param-value>mysql</param-value>
<description>
DB password
</description>
</context-param>
This in my jsp:
<sql:connection id="conn1">
<sql:url initParameter="dbURL"/>
<sql:driver initParameter="mysqlDriver"/>
<sql:userId initParameter="dbUserId"/>
<sql:password initParameter="dbPassword"/>
</sql:connection>
and this in the poolman.xml file:
<?xml version="1.0" encoding="UTF-8"?>
<poolman>
<management-mode>local</management-mode>
<!-- ========================================================== -->
<!-- These entries are an example of JDBC Connection pooling. -->
<!-- Many of the parameters are optional. Consult the -->
<!-- UsersGuide.html doument and the poolman.xml.template file -->
<!-- for guidance and element definitions. -->
<!-- ========================================================== -->
<datasource>
<!-- ============================== -->
<!-- Physical Connection Attributes -->
<!-- ============================== -->
<!-- Standard JDBC Driver info -->
<dbname>dancevibes</dbname>
<driver>org.gjt.mm.mysql.Driver</driver>
<url>jdbc:mysql://localhost/dancevibes</url>
<username>mysql</username>
<password>mysql</password>
<minimumSize>0</minimumSize>
<maximumSize>10</maximumSize>
<connectionTimeout>600</connectionTimeout>
<userTimeout>12</userTimeout>
<shrinkBy>10</shrinkBy>
<logFile>testdb.log</logFile>
<debugging>true</debugging>
<!-- Query Cache Attributes-->
<cacheEnabled>true</cacheEnabled>
<cacheSize>20</cacheSize>
<cacheRefreshInterval>120</cacheRefreshInterval>
</datasource>
<!-- DISABLED FOR PRODUCTION
<admin-agent>
<class>com.sun.jdmk.comm.HtmlAdaptorServer</class>
<name>Adaptor:name=html</name>
<maxClients>10</maxClients>
<port>8082</port>
</admin-agent>
-->
</poolman>