StringBuffer sql = new StringBuffer(512);
sql.append("SELECT ThreadID, ForumID, MemberName, LastPostMemberName, ThreadTopic, ThreadBody");
sql.append(" FROM " + TABLE_NAME);
sql.append(" ORDER BY " + sort + " " + order);
sql.append(" LIMIT ?, ?");
What is LIMIT? What do those question marks stand for?
The question marks are there to allow paramater binding. You would run this as a PreparedStatement and supply bind values to substitute in to the ?. That being said, I think LIMIT can only take one arguement, so I'd be surprised if the query works.