preparedStatement = connection.prepareStatement("select fname,lname, "
+ "sportman_code,start,finish,salary,amount,number,pnumber "
+ "from sportman,customer "
+ "where customer.customer_code = "
+ "sportman.customer_code order by ? limit ?,?");
preparedStatement.setString(1, "fname");
preparedStatement.setInt(2, 0);
preparedStatement.setInt(3, 9);
resultSet = preparedStatement.executeQuery();
排序方式沒有奏效。 爲什麼?準備聲明的問題
當我把fname改爲?它工作正常。
"sportman.customer_code order by fname limit ?,?");
我該怎麼做?
+1爲M&M圖像。 – 2011-04-22 21:22:17