aspose file tools
The moose likes JDBC and Relational Databases 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


Win a copy of Groovy Fundamentals video training course this week in the Groovy forum!
JavaRanch » Java Forums » Databases » JDBC and Relational Databases
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: 1137
    
    1

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
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Please Point Out My Mistakes