I'm getting a java.sql.SQLException: The statement is closed. error in Jboss.
Do you notice any problem in the code or config file?
server.log:
2007-12-20 18:00:08,025 TRACE
[org.jboss.resource.connectionmanager.JBossManagedConnectionPool] Returning
connection to pool org.jboss.resource.connectionman
[EMAIL PROTECTED] [EMAIL PROTECTED] handles=0 l
astUse=1198191608025 permit=false trackByTx=false [EMAIL PROTECTED]
context=org.jboss.resou
[EMAIL PROTECTED] [EMAIL PROTECTED] txSy
nc=null] [InUse/Available/Max]: [6/88/100]
2007-12-20 18:00:08,041 INFO [STDOUT] Exception in processReading
java.sql.SQLException: The statement is closed.
2007-12-20 18:00:08,041 INFO [STDOUT] Test 6
oracle-ds.xml:
OracleDS
false
jdbc:oracle:thin:@ldcdevl:1521:
oracle.jdbc.driver.OracleDriver
x
x
10
100
200
0
5
30
true
Oracle9i
public class BillingResponseDAO {
private DBConnection dbCon = null;
private List billingReadList = new ArrayList();
private BillingRead billingRead = null;
private com.th.commonUtil.intface.Context ctx = null;
public String premCode = null;
public String servNum = null;
public static final String billingResponseString =
"INSERT INTO UXBSRRS values (?,?,?,?,?,?,?,SYSDATE,USER)";
public static final String billingResponseDetailString =
"INSERT INTO UXRSRRS values (?,?,?,?,?)";
AppContext appCtxt = null;
public BillingResponseDAO() {
}
public BillingResponseDAO(String test) {
}
public
void init(Context ctx) {
System.out.println("Inside BillingResponseDAO 1");
try {
dbCon = ctx.getDBConMDB();
dbCon.getConnectionMDB();
} catch (Exception e) {
System.out.println("Exception in BillingResponseDAO init" + e);
}
}
public void processReading(BillingResponse bResponse) throws Exception {
PreparedStatement stmt = null;
PreparedStatement stmt1 = null;
String premCodeLocal = null;
String noData = null;
String validationStatus = null;
String status = "N";
String dateStr = null;
String dateStr1 = null;
String dateStr2 = null;
String dateStr3 = null;
try {
if (dbCon == null) {
dbCon = ctx.getDBConMDB();
dbCon.getConnectionMDB();
}
stmt =
(PreparedStatement)dbCon.getCachedStatement(billingResponseString);
stmt1 =
(PreparedStatement)dbCon.getCachedStatement(billingResponseDetailString);
if (stmt != null) {
DBUtil.setString(stmt, 1, bResponse.getTransactionID());
/** Commented on May 21 JCH *
parseSDP(bResponse.getSDP());
premCodeLocal = removeLeadingZeros(premCode);
DBUtil.setString(stmt, 2, premCodeLocal);
DBUtil.setLong(stmt, 3, Long.parseLong(servNum));
DBUtil.setString(stmt, 4, bResponse.getMeterNum());
*/
/* Added the code Below May 21**/
Long localServNum=null;
String tempSDP = null;
tempSDP = bResponse.getSDP();
System.out.println("Temp SDP ="+tempSDP);
if ( (tempSDP == null) ||
(tempSDP.equals(""))
)
{
DBUtil.setString(stmt, 2, premCode);
DBUtil.setLong(stmt, 3,localServNum);
}
else{
parseSDP(bResponse.getSDP());
premCodeLocal = removeLeadingZeros(premCode);
DBUtil.setString(stmt, 2, premCodeLocal);
DBUtil.setLong(stmt, 3, Long.parseLong(servNum));
}
/* End the code Below May 21**/
DBUtil.setString(stmt, 4, bResponse.getMeterNum());
String tempReadDate = bResponse.getReadDate();
if ( (tempReadDate ==null)||
(tempReadDate.equals(""))
)
{
DBUtil.setDate(stmt, 5,null);
}
else
{
dateStr = bResponse.getReadDate();
dateStr1 = new String(dateStr.substring(0, 10));
dateStr2 = new String(dateStr.substring(11, 19));
dateStr3 = dateStr1 + " " + dateStr2;
System.out.println("dateStr =" + dateStr3);
String testString = getDateTime(dateStr3);
SimpleDateFormat df =
new SimpleDateFormat("-MM-dd HH:mm:ss");
DBUtil.setDate(stmt, 5, df.parse(testString));
}
DBUtil.setString(stmt,