i*****t 发帖数: 220 | 1 I write this query:
String query = null;
query = "SELECT * from messages where " + "destname = '" + name + "'";
ResultSet rs = statement.executeQuery (query);
After running, the system always says: SQLException :No data found
But if I go to the database using SQL: SELECT * from messages where destname =
'clinton'; it works and finds data. What is wrong? | g**n 发帖数: 431 | 2 Check the value of name
【在 i*****t 的大作中提到】 : I write this query: : String query = null; : query = "SELECT * from messages where " + "destname = '" + name + "'"; : ResultSet rs = statement.executeQuery (query); : After running, the system always says: SQLException :No data found : But if I go to the database using SQL: SELECT * from messages where destname = : 'clinton'; it works and finds data. What is wrong?
|
|