File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes JDBC and the fly likes Please Point Out My Mistakes Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » JDBC
Bookmark "Please Point Out My Mistakes" Watch "Please Point Out My Mistakes" New topic
Author

Please Point Out My Mistakes

JiaPei Jen
Ranch Hand

Joined: Nov 19, 2000
Posts: 1309
I am using the MySQL and Tomcat. This time, I am trying to look for some records in the database, use LIMIT to retrieve the first 20, and sort them in descending order according to the criterion given to String sort.

int offset = 0;
int rows = MessageInboxConfig.ROWS_IN_THREADS; (which is 20)
String sort = "thread_last_post_date";
String order = "DESC";

Something is wrong with the method getThreadBeans_forReceiver_withSortSupport_limit_mysql in the MySQLMessageDAO class, I got this error message in the Tomcat log:


[ May 21, 2004: Message edited by: JiaPei Jen ]

[ May 21, 2004: Message edited by: JiaPei Jen ]
[ May 21, 2004: Message edited by: JiaPei Jen ]
Avi Abrami
Ranch Hand

Joined: Oct 11, 2000
Posts: 1135

Jen,
This is just a guess. You forgot to put a space before "LIMIT":
order + "LIMIT ?, ?";

Shouldn't that be:

(Notice the space before the word LIMIT.)

By the way,
I got this error message in the Tomcat log:

I couldn't find the error message in your post.

Good Luck,
Avi
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Please Point Out My Mistakes