1
public boolean isAuditTrailEnabled(String masterAccessId)
{
String selectQuery = "select t.audit_flag from PARAMETER_MENU_ATTRIBUTES t where t.access_id = '"+masterAccessId+"'";
PreparedStatement preparedStmnt = null;
ResultSet resultSet = null;
String flag = "N";
if(connection == null)
{
initConnection();
}
try {
**preparedStmnt = connection.prepareStatement(selectQuery);**
resultSet = preparedStmnt.executeQuery();
if(resultSet.next())
{
flag = resultSet.getString(1);
}
}
catch (SQLException e) {
try {
if (resultSet != null){
resultSet.close();
}
if (preparedStmnt != null){
preparedStmnt.close();
}
} catch (SQLException e1) {
}
return true;
}
finally{
try {
if (resultSet != null){
resultSet.close();
}
if (preparedStmnt != null){
preparedStmnt.close();
}
cleanup();
} catch (SQLException e1) {
return false;
}
}
if(flag.equals("N")){
return false;
}else{
return true;
}
}
它顯示該特定語句的問題。你可以幫我嗎?聲納顯示方法可能無法清除流或資源檢查異常
thnk ui ll試試看 –