Sagewire Logo

Connector/J 3.1.16 LIMIT Exception

2 Message(s) by 2 Author(s) originally posted in mysql java


From: axelmuench Date:   Tuesday, January 11, 2005
Hi,

Since we upgraded our staging server from Connector/J 3.0.14+ to
Connector/J 3.1.16 ( on mysql 4.1.17) we receive for any SQL
PreparedStatements ending in "LIMIT ?,?" a JAVA.sql.SQLException:

You've an error in your SQL syntax ; check the manual that corresponds
to your MySQL server version for the right syntax to use near '?,?' at
line 1

Example:
private static final String PRODUCT_BY_RANGE_LIMIT = "SELECT * FROM
Product LIMIT ?,?";
~cut
prepStmt.setInt(1, index);
prepStmt.setInt(1, range);
~cut
Anybody else came across this problem?

Thanks,

Axel--
MySQL JAVA Mailing List
For list archives: http://lists.mysql.com/JAVA
To unsubscribe: http://lists.mysql.com/JAVA?unsub=mysql-JAVA@xxxxxxxxxxx


From: kencochrane Date:   Wednesday, February 09, 2005
Axel,

I am also getting the error, that you listed. Have you found a solution
to the problem?

Here is the error that I am getting:
"JAVA.sql.SQLException: You've an error in your SQL syntax; check the
manual that corresponds to your MySQL server version for the right
syntax to use near '?' at line 1"

I am getting the error now that I've switched from MySQL 4.0.x to
4.1.9 and I am using MySQL connector/J 3.1.6 and Tomcat 4.1.31

Thanks,
Ken Cochrane
http://PopcornMonsters.com

wrote in message:
Hi,
Since we upgraded our staging server from Connector/J 3.0.14+ to
Connector/J 3.1.16 ( on mysql 4.1.17) we receive for any SQL
PreparedStatements ending in "LIMIT ?,?" a JAVA.sql.SQLException:
You've an error in your SQL syntax; check the manual that
corresponds
to your MySQL server version for the right syntax to use near '?,?'
at
line 1
Example:
private static final String PRODUCT_BY_RANGE_LIMIT = "SELECT * FROM
Product LIMIT ?,?";
~cut
prepStmt.setInt(1, index);
prepStmt.setInt(1, range);
~cut
Anybody else came across this problem?
Thanks,
Axel
--
MySQL JAVA Mailing List
For list archives: http://lists.mysql.com/JAVA
To unsubscribe:


http://lists.mysql.com/JAVA?unsub=mysql-JAVA@xxxxxxxxxxx



Next Message: Portable JAVA Data Layer based on JDBC



Programming | Sports | Autos

copyright 2006
Valid XHTML 1.0 Transitional