One of the cause of this error can be found in the following snippet of code:
query = "select * from AAA where condn = ?";
pstmt = con.prepareStatement(query);
pstmt.setString(1, firstValue);
// ResultSet rs = pstmt.executeQuery(query); // Wrong Usage - Do not provide query again
ResultSet rs = pstmt.executeQuery(); // Correct Usage
Another reason is that you have not mapped all '?' with corresponding values
No comments:
Post a Comment