/** * drops tables, statement oder defined by * {@link #getOrderedNamesForDrop()} * * @throws IOException */ public void dropTables() throws IOException { Connection con = null; PreparedStatement ps = null; try { con = getConnection(); for (String stmt : getOrderedNamesForDrop()) { ps= getDDLStatement(stmt, con); ps.execute(); ps.close(); } } catch (SQLException ex) { throw new IOException(ex); } finally { closeFinally(con, ps, null); } }
public static void dropExistingTables(AbstractJDBCService service,Connection con) throws IOException { PreparedStatement ps = null; try { for (String stmt : service.getOrderedNamesForDrop()) { try { ps= service.getDDLStatement(stmt, con); ps.execute(); ps.close(); } catch (SQLException ex) { //ex.printStackTrace(); } } con.commit(); } catch (SQLException ex) { throw new IOException(ex); } finally { try { if (ps!=null) ps.close(); } catch (SQLException ex) {}; } }
public static void dropExistingTables(AbstractJDBCService service, Connection con) throws IOException { PreparedStatement ps = null; try { for (String stmt : service.getOrderedNamesForDrop()) { try { ps = service.getDDLStatement(stmt, con); ps.execute(); ps.close(); } catch (SQLException ex) { // ex.printStackTrace(); } } con.commit(); } catch (SQLException ex) { throw new IOException(ex); } finally { try { if (ps != null) ps.close(); } catch (SQLException ex) { } ; } }