public class X { public static void notif(DomWrapper xml, int notifType) throws DatabaseErrorException CallableStatement st = null; ResultSet rs = null; Connection con = null; int tempInt = -1; String tempStr = null; int index = 0; String prefix = "notif: type(" + notifType +")"; try { con = DataSourceManager.getConnection(); String sql = null; st =con.prepareCall(sql); tempInt = xml.getAttAsInt(FulfillmentParser.SHIPMENT_ID); st.setInt(++index, tempInt) ; st.registerOutParameter(++index, Types.VARCHAR); st.execute(); String status = st.getString(index); if ( !OK.equals(status) ) throw new DatabaseErrorException(prefix + " Fail to insert record to db " + status ,status); } catch (SQLException e) { Debugger.error(prefix + " Fail insert record to db xml = " + xml, e); throw new DatabaseErrorException(prefix " Fail to insert record to db " + e.getMessage()); } finally { close(con, st); } } }