
How to write code example for select with preparedstatement in java?
Thanks

Hi,
Following code examples can be used:
PreparedStatement pstmt =
conn.prepareStatement("select id from keyworduniquetable where keyword=?");
pstmt.setString(1, keyword);
ResultSet rstSelect = pstmt.executeQuery();
while(rstSelect.next()) {
}
rstSelect.close();
pstmt.close();
Thanks
If you are facing any programming issue, such as compilation errors or not able to find the code you are looking for.
Ask your questions, our development team will try to give answers to your questions.