• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Please Point Out My Mistakes

 
Ranch Hand
Posts: 1309
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 ]
 
Ranch Hand
Posts: 1143
1
Eclipse IDE Oracle Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
What's brown and sticky? ... a stick. Or a tiny ad.
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic