private static BigDecimal getUserId(String userName, BaseAMImpl am){
PreparedStatement pStatement = null;
try {
String sql = "select user_id from fnd_user where UPPER(user_name) like upper(?)";
pStatement = am.getDBTransaction().createPreparedStatement(sql, 1);
pStatement.setString(1, userName);
ResultSet result = pStatement.executeQuery();
if (result.next()) {
BigDecimal userId = result.getBigDecimal("user_id");
return userId;
}
} catch (Exception e) {
e.printStackTrace();
} finally {
try {
pStatement.close();
} catch (Exception e) {
e.printStackTrace();
}
}
return null;
}
No comments:
Post a Comment