私のクエリが次のようなものであるとします。ここで conn は接続オブジェクトです:
String countrycode=91;//it is dynamic in my case
String query = "update tblemployeedata set countrycode='?';
PreparedStatement pstmtUpdate = conn.prepareStatement(query);
pstmtUpdate.setString(1,countrycode);
上記の国コードを設定した後、実際のクエリが次のように形成されていることを確認したい
update tblemployeedata set countrycode='91';
pstmtUpdate.executeUpdate();