private int populateStatement(PreparedStatement pst, SearchBuilderItem sbi) throws SQLException { pst.setString(1, sbi.getName()); pst.setString(2, sbi.getContext()); pst.setInt(3, sbi.getSearchaction().intValue()); pst.setInt(4, sbi.getSearchstate().intValue()); pst.setDate(5, new Date(sbi.getVersion().getTime())); pst.setInt(6, sbi.getItemscope().intValue()); pst.setString(7, sbi.getId()); return 7; }
private void delete(Connection connection, SearchBuilderItem sbi) throws SQLException { PreparedStatement pst = null; try { pst = connection.prepareStatement( " delete from " //$NON-NLS-1$ + SEARCH_BUILDER_ITEM_T + " where id = ? "); //$NON-NLS-1$ pst.clearParameters(); pst.setString(1, sbi.getId()); pst.execute(); } catch (SQLException ex) { log.warn("Failed ", ex); // $NON-NLS-1$ throw ex; } finally { try { pst.close(); } catch (Exception ex) { log.debug(ex); } } }