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/08/10 20:46:42 UTC

[dbcp] java.sql.SQLException: Incorrect arguments to mysql_stmt_execute

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 commons-dbcp
infrastructure to manage the db connection pool. So far I observed that
the problematic queries look like "SELECT COLUMN1, COLUMN2, COLUMN3,
COLUMN4 FROM MYTABLE". (Note: one of the queries uses DISTINCT) This is
the dbcp-related configuration I have (I guess most significant thing is
poolPreparedStatements = true):

 

******************************************************************

factory = org.apache.commons.dbcp.BasicDataSourceFactory

username = myuser

password = mypwd

driverClassName = com.mysql.jdbc.Driver

url =
jdbc:mysql://localhost:3306/MYDB?autoReconnect=true&useServerPrepStmts=f
alse&jdbcCompliantTruncation=false

maxActive = 15

maxWait = 360000

removeAbandonedTimeout = 1800000

removeAbandoned = true

logAbandoned = true

poolPreparedStatements = true

*******************************************************************

 

Any Ideas?

 

Pramodh.


Re: [dbcp] java.sql.SQLException: Incorrect arguments to mysql_stmt_execute

Posted by Brian Cook <bc...@printtime.com>.
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 commons-dbcp
> infrastructure to manage the db connection pool. So far I observed that
> the problematic queries look like "SELECT COLUMN1, COLUMN2, COLUMN3,
> COLUMN4 FROM MYTABLE". (Note: one of the queries uses DISTINCT) This is
> the dbcp-related configuration I have (I guess most significant thing is
> poolPreparedStatements = true):
> 
>  
> 
> ******************************************************************
> 
> factory = org.apache.commons.dbcp.BasicDataSourceFactory
> 
> username = myuser
> 
> password = mypwd
> 
> driverClassName = com.mysql.jdbc.Driver
> 
> url =
> jdbc:mysql://localhost:3306/MYDB?autoReconnect=true&useServerPrepStmts=f
> 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.
bcook@printtime.com