dbTalk Databases Forums  

Connector/J 3.1.16 LIMIT Exception

mailing.database.mysql-java mailing.database.mysql-java


Discuss Connector/J 3.1.16 LIMIT Exception in the mailing.database.mysql-java forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Axel Muench
 
Posts: n/a

Default Connector/J 3.1.16 LIMIT Exception - 01-11-2005 , 04:36 AM






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 have 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=my...ie.nctu.edu.tw


Reply With Quote
  #2  
Old   
kencochrane@gmail.com
 
Posts: n/a

Default Re: Connector/J 3.1.16 LIMIT Exception - 02-09-2005 , 03:48 PM






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 have 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 have 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

Axel Muench wrote:
Quote:
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 have 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=my...ie.nctu.edu.tw



Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.