commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Pramodh Peddi" <>
Subject RE: [dbcp] java.sql.SQLException: Incorrect arguments to mysql_stmt_execute
Date Mon, 15 Aug 2005 18:03:58 GMT
Hi Brook,

Thanks for the email. Sorry for not being clear in my SQL queries. I
think the problem has disappeared now. And I believe commons-dbcp tool
did not play any role in the problem. The db connection url had "
useServerPrepStmts=true" and MySQL server 4.1.4 gamma does not fully
support server-side prepared stmts. As soon as I changed it to "
useServerPrepStmts=false", everything started working fine.

Again, thanks for the response.


-----Original Message-----
From: Brian Cook [] 
Sent: Wednesday, August 10, 2005 3:26 PM
To: Jakarta Commons Users List
Subject: Re: [dbcp] java.sql.SQLException: Incorrect arguments to

The ability to give a detailed answer to a question like this is mainly 
limited to the level of detail given.  i.e.  If you want a specific 
response we would really need to see the actually SQL string causing the

exception, the exact SQL Exception including the details, the code that 
uses commons.dbcp, and the JNDI config files if JNDI is being used.

My understanding is that commons.dbcp is completely transparent to the 
SQL commands sent.  All commmons.dbcp is doing is getting the connection

for you.  From there it is all standard JDBC.

I usually log the the SQL string and the details of the exception any 
time a java.sql.SQLException exception is caught.  It makes it easier to

see where problems are.  Especially when they are interment. 
Additionally when you you think the error is caused by another package 
you can then pass along exact details of the failing to that group.

Pramodh Peddi wrote:
> Hi,
> I am using commons-dbcp-1.2 to manage my db connection pool w/
> MySQL-4.1.4-gamma. On Linux (Suse) I am finding an SQLException very
> frequently so far. The actual exception is "java.sql.SQLException:
> Incorrect arguments to mysql_stmt_execute". Not all the queries are
> giving this problem. Only a couple of them, which are very simple, are
> being problematic. This happened ever since I am using the
> infrastructure to manage the db connection pool. So far I observed
> the problematic queries look like "SELECT COLUMN1, COLUMN2, COLUMN3,
> COLUMN4 FROM MYTABLE". (Note: one of the queries uses DISTINCT) This
> the dbcp-related configuration I have (I guess most significant thing
> poolPreparedStatements = true):
> ******************************************************************
> factory = org.apache.commons.dbcp.BasicDataSourceFactory
> username = myuser
> password = mypwd
> driverClassName = com.mysql.jdbc.Driver
> url =
> alse&jdbcCompliantTruncation=false
> maxActive = 15
> maxWait = 360000
> removeAbandonedTimeout = 1800000
> removeAbandoned = true
> logAbandoned = true
> poolPreparedStatements = true
> *******************************************************************
> Any Ideas?
> Pramodh.

Brian Cook
Digital Services Analyst
Print Time Inc.

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message