Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Agile forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Please Point Out My Mistakes

 
JiaPei Jen
Ranch Hand
Posts: 1309
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 1141
1
Java Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic