//Class UserProfileDBUtil.java
Connection conn = null;
PreparedStatement statment = null;
ResultSet rs = null;
try{
String sqlString = "select count(*) from "+AGENCY_SCHEMA_NAME+".AGENCY WHERE AGENCYCODE= ? and ENABLEDFLAG = ?";
conn = JDBCUtils.getConnection(JDBCUtils.WP_ODS);
statment = conn.prepareStatement(sqlString);
statment.setString(1, agencyCode.toUpperCase());
statment.setString(2, "Y");
rs =statment.executeQuery(); // SQL Error Line 42
while(rs.next())
{
if(rs.getInt(1) > 0 )
{
return true;
}
}
log.error("Agency for agency code "+agencyCode+" is not available or not active");
}
ログ:
com.ibm.db2.jcc.b.SqlException: DB2 SQL エラー: SQLCODE: -401、SQLSTATE: 42818、SQLERRMC: = at com.ibm.db2.jcc.b.sf.e(sf.java:1680) at com.ibm.db2.jcc.b.sf.a(sf.java:1239) at com.ibm.db2.jcc.c.jb.h(jb.java:139) at com.ibm.db2.jcc. c.jb.a(jb.java:43) at com.ibm.db2.jcc.cwa(w.java:30) at com.ibm.db2.jcc.c.cc.g(cc.java:161) com.ibm.db2.jcc.b.sf.n(sf.java:1219) com.ibm.db2.jcc.b.tf.gb(tf.java:1818) com.ibm.db2.jcc com.ibm.db2.jcc.b.tf.X(tf.java:508) の .b.tf.d(tf.java:2294) com.ibm.db2.jcc.b.tf.executeQuery(tf .java:491) で com.ibm.ws.rsadapter.jdbc.WSJdbcPreparedStatement.executeQuery(WSJdbcPreparedStatement.java:559) で UserProfileDBUtil.isAgencyActive(UserProfileDBUtil.java:42) で