假设我的查询是这样的,这里 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();