D:\pramatiStudio\temp\Impl\PayScribe_Combine\PayScribe_Customer\java\CustomerServiceImpl_353177033.java:557: catch not reached.
}catch(javax.ejb.ObjectNotFoundException appExcep){
^
D:\pramatiStudio\temp\Impl\PayScribe_Combine\PayScribe_Customer\java\CustomerServiceImpl_353177033.java:587: catch not reached.
}catch(javax.ejb.ObjectNotFoundException appExcep){
^
2 errors
I am new to
EJB. I am using Pramati Application server to complile and deploy the EJB. While compiling i am not getting any errors. But when i deploy my ear file, i get the error pasted above. Please suggest some solution
Below i am pasting the two functions, which contain line 557 and 587 in which i am encountering the errors.
TIA
Manish
private Collection selectDeactivateCustomer() throws ObjectNotFoundException, SQLException
{
Debug.traceln("selectDeactivateCustomer: Entered");
Connection con = this.getConnection();
PreparedStatement prepStmt = null;
ResultSet rs = null;
ArrayList array = new ArrayList();
try
{
String selectStatement = "select objectid, customerid, name from customer where currentstate = ?";
prepStmt = con.prepareStatement(selectStatement);
prepStmt.setString(1, "D");
rs = prepStmt.executeQuery();
Debug.traceln("selectDeactivateCustomer:Query Executed");
while(rs.next())
{
CustomerStatusInfo statusInfo = new CustomerStatusInfo();
statusInfo.objectId = rs.getString(1);
statusInfo.customerId = rs.getString(2);
statusInfo.name = rs.getString(3);
array.add(statusInfo);
}
if(array.size() == 0)
{
Debug.traceln("selectDeactivateCustomer:No such entity exception");
throw new ObjectNotFoundException("Row for Deactivated Customer not found in database.");
}
else
{
return array;
}
}
catch(SQLException sq)
{
Debug.traceln("selectDeactivateCustomer Thrown SQL Exception");
throw new SQLException("selectDeactivateCustomer has raised Exception: " +
sq.getMessage());
}
finally
{//LINE 557 rs.close();
prepStmt.close();
con.close();
}
}
private void modifyCustomer(ArrayList list) throws SQLException
{
Debug.traceln("modifyCustomer: Entered");
Connection con = this.getConnection();
PreparedStatement prepStmt = null;
String updateStatement = "update customer set currentstate='E' where objectid=?";
try
{
for(int i=0; i < list.size(); i++)
{
prepStmt = con.prepareStatement(updateStatement);
prepStmt.setString(1, (String)list.get(i));
int rowCount = prepStmt.executeUpdate();
Debug.traceln("modifyCustomer: Query Executed");
if (rowCount == 0)
{
Debug.traceln("modifyCustomer: EJB Exception");
throw new EJBException("Updating row for objectid " + (String)list.get(i) + " failed.");
}
}
}
catch(SQLException sq)
{
Debug.traceln("modifyCustomer Thrown SQL Exception");
throw new SQLException("Store Row has raised Exception: " + sq.getMessage());
}
finally
{//LINE 587 prepStmt.close();
con.close();
}
}
[ July 01, 2003: Message edited by: Manish Sachdev ]