You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@commons.apache.org by Pramodh Peddi <pp...@IMPRIVATA.com> on 2005/06/15 22:23:31 UTC
useServerPrepStmts and jdbcCompliantTruncation for MySQL with dbcp
Hi,
I am introducing apache's DBCP tool into our product, which uses MySQL.
Till now, we used different mysql specific properties in the db url. The
url we used is:
"jdbc:mysql://localhost:3306/MYDATABASE?autoReconnect=true&useServerPrep
Stmts=false&jdbcCompliantTruncation=false". And while making dbcp work,
this is the exactly the same URL I gave to
<parameter>
<name>url</name>
<value>jdbc:
jdbc:mysql://localhost:3306/MYDATABASE?autoReconnect=true&useServerPrepS
tmts=false&jdbcCompliantTruncation=false </value>
</parameter>
in Tomcat's server.xml. When I start tomcat, it complains saying "The
reference to entity "useServerPrepStmts" must end with the ';'
delimiter". And when I removed useServerPrepStmts from the URL, it
started complaining the same thing about jdbcCompliantTruncation.
Can we not use these properties when I use apache's DBCP tool?
"useServerPrepStmts" can be achieved because DBCP tool itself has
poolPreparedStatements, which can be defined in server.xml. But what
about other many useful properties offered by MySQL/MySQL-Connector-J?
Thanks in advance,
Pramodh.
Re: useServerPrepStmts and jdbcCompliantTruncation for MySQL with
dbcp
Posted by Dirk Verbeeck <di...@pandora.be>.
When you want to put a "&" sign in a xml file like server.xml then you
need to use the & entity.
For example:
<value>
jdbc:mysql://localhost:3306/MYDATABASE?autoReconnect=true&useServerPrepStmts=false&jdbcCompliantTruncation=false
</value>
-- Dirk
Pramodh Peddi wrote:
> Hi,
>
> I am introducing apache's DBCP tool into our product, which uses MySQL.
> Till now, we used different mysql specific properties in the db url. The
> url we used is:
> "jdbc:mysql://localhost:3306/MYDATABASE?autoReconnect=true&useServerPrep
> Stmts=false&jdbcCompliantTruncation=false". And while making dbcp work,
> this is the exactly the same URL I gave to
> <parameter>
>
> <name>url</name>
>
> <value>jdbc:
> jdbc:mysql://localhost:3306/MYDATABASE?autoReconnect=true&useServerPrepS
> tmts=false&jdbcCompliantTruncation=false </value>
>
> </parameter>
>
>
>
> in Tomcat's server.xml. When I start tomcat, it complains saying "The
> reference to entity "useServerPrepStmts" must end with the ';'
> delimiter". And when I removed useServerPrepStmts from the URL, it
> started complaining the same thing about jdbcCompliantTruncation.
>
>
>
> Can we not use these properties when I use apache's DBCP tool?
> "useServerPrepStmts" can be achieved because DBCP tool itself has
> poolPreparedStatements, which can be defined in server.xml. But what
> about other many useful properties offered by MySQL/MySQL-Connector-J?
>
>
>
> Thanks in advance,
>
>
>
> Pramodh.
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-user-help@jakarta.apache.org