This week's book giveaway is in the OCMJEA forum. We're giving away four copies of OCM Java EE 6 Enterprise Architect Exam Guide and have Paul Allen & Joseph Bambara on-line! See this thread for details.
Abe, The database is complaining about the first question mark (the one after the keyword top.) In JDBC, you can't substitute just any part of the SQL in through a prepared statement. Basically, you can only put a value in (for the where clause.) You are going to need to build the first part of the statement dynamically.