Advertisement
Guest User

Untitled

a guest
Jul 2nd, 2015
197
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.81 KB | None | 0 0
  1. String getExistingFileEntry = "select * from test "
  2. + " where a = ? and b = ? and date < DATE_SUB(NOW(), INTERVAL 1 DAY)"
  3. + "order by id"
  4. + "limit 1";
  5.  
  6. PreparedStatement pstVerify = null;
  7. pstVerify = con.prepareStatement(getExistingFileEntry);
  8. pstVerify.setString(1, a);
  9. pstVerify.setString(2, b);
  10.  
  11. ResultSet rsFirst =null;
  12. String existingSum = null;
  13. //execute select SQL statement
  14. rsFirst = pstVerify.executeQuery();
  15.  
  16. com.mysql.jdbc.exceptions.MySQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '1' at line 1
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement