java sql help!# Database - 数据库
i*t
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?
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?