I can execute the following sql inside the db2 command center and works fine.
values GetInvRespCntClmId(1);
Java Code
public
String xyz(Connection con,int anInteger){
int responces = 0;
PreparedStatement pstmt = null;
try {
pstmt = con.prepareStatement("values GetInvRespCntClmId(?)");
pstmt.setInt(1, anInteger);
ResultSet rs = pstmt.executeQuery();
while (rs.next()) {
responces = rs.getInt(1);
}
rs.close();
pstmt.close();
} catch (SQLException e) {
e.printStackTrace();
} finally {
try {
pstmt.close();
} catch (SQLException e1) {
e1.printStackTrace();
}
}
return new Integer(responces).toString();
}
I get a DB2 --- DB2 SQL error: SQLCODE: -418, SQLSTATE: 42610, SQLERRMC: null
Any suggestions?
Thank You!