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. Pramodh. -----Original Message----- From: Brian Cook [mailto:[EMAIL PROTECTED] Sent: Wednesday, August 10, 2005 3:26 PM To: Jakarta Commons Users List Subject: Re: [dbcp] java.sql.SQLException: Incorrect arguments to mysql_stmt_execute 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. [EMAIL PROTECTED] --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
