I have written a code which is giving this exception
SQL0904N Unsuccessful execution caused by an unavailable resource. Reason code: "00D70027", type of resource: "00000220", and resource name: "DB2B.DSNDBC.DSNDB07.DSN4K05.I0001.A001". SQLSTATE=57011
at COM.ibm.db2.jdbc.app.SQLExceptionGenerator.throw_SQLException(Unknown Source)
at COM.ibm.db2.jdbc.app.SQLExceptionGenerator.throw_SQLException(Unknown Source)
at COM.ibm.db2.jdbc.app.SQLExceptionGenerator.check_return_code(Unknown Source)
at COM.ibm.db2.jdbc.app.DB2Statement.execute2(Unknown Source)
at COM.ibm.db2.jdbc.app.DB2Statement.executeQuery(Unknown Source)
at com.ibm.divest.vo.CurrentFile.processLine(CurrentFile.java:465)
Scenario:
Database: DB2 9.2
Java: 5
JDBC Driver - Type 2
Executing a SELECT query again and again for n number of times. I am using this SELECT query with - "FOR READ ONLY WITH UR".
I am using same Connection again and again but closing ResultSet & Statement Object after each query and creating new one each time.
I am getting this exception at execute statement().
Code:
Statement psGetRdc=null;
ResultSet rsKna1=null;
psGetRdc = getCon().createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE,ResultSet.CONCUR_READ_ONLY);
rsKna1 = psGetRdc.executeQuery(fetchDataFromRDCSQL);
When other application run at the same time and use the same table then only I get this exception.
This is related to Database - DataSet.
I do not know how to resolve it.
The only way I am able to think is close the connection after N number of records. Because the code is so fast that JAVA is releasing memory but Database is not able to release POOL.
I am not able to find the solution any where.
Can you please help.
Thanks