private String getITResourceKey(String applicationInstanceName) {
System.out.println(CLASS_NAME + " Start of getITResourceKey()");
Connection connection = null;
PreparedStatement pstmt = null;
ResultSet rs = null;
String itResourceKey = null;
try {
String query = "select itresource_key from app_instance where app_instance_display_name=?";
pstmt = connection.prepareStatement(query);
pstmt.setString(1, applicationInstanceName);
rs = pstmt.executeQuery();
if (rs.next()) {
itResourceKey = rs.getString("itresource_key");
}
} catch (Exception e) {
e.printStackTrace();
}finallly{
connection.close();
pstmt.close();
rs.close();
}
return itResourceKey;
}
No comments:
Post a Comment