Package java.sql

Examples of java.sql.Connection.rollback()


                    } catch (SQLException xcpt) {
                      iErrorCount++;
                      if (DebugFile.trace) DebugFile.writeln("  SQLException: at line "+String.valueOf(iLine)+" "+xcpt.getMessage());
                      if (bRecoverable) {
                        if (DebugFile.trace) DebugFile.writeln("  Connection.rollback()");
                        try { oConn.rollback(); } catch (SQLException ignore) {}
                      } // fi (bRecoverable)
                      if (oBadWrtr!=null) {
                        oBadWrtr.write("SQLException: at line "+String.valueOf(iLine)+" "+xcpt.getMessage()+"\r\n");
                        oBadWrtr.write(sLine+"\r\n");
                      } // fi
View Full Code Here


        oImplLoad.close();
        if (bRecoverable) {
          if (0==iErrorCount)
            oConn.commit();
          else
            oConn.rollback();
        }

        if (DebugFile.trace) DebugFile.writeln("Connection.close()");
        oConn.close();
      } catch (SQLException xcpt) {
View Full Code Here

        try { if (null!=oDiscardWrtr) oDiscardWrtr.close(); } catch (Exception ignore) {}
        try { if (null!=oBadWrtr) oBadWrtr.close(); } catch (Exception ignore) {}
        try { if (null!=oInBuff) oInBuff.close(); } catch (Exception ignore) {}
        try { if (null!=oInStrm) oInStrm.close(); } catch (Exception ignore) {}
        try { oImplLoad.close(); } catch (Exception ignore) {}
        try { if (bRecoverable) oConn.rollback(); } catch (Exception ignore) {}
        try { oConn.close(); } catch (Exception ignore) {}
        throw new ImportExportException(xcpt.getClass().getName() + " " + xcpt.getMessage() + " at row " + String.valueOf(r));
      }
      catch (IOException xcpt) {
             if (DebugFile.trace) DebugFile.writeln("  "+xcpt.getClass().getName()+": at row "+String.valueOf(r)+" "+xcpt.getMessage());
View Full Code Here

             try { if (null!=oDiscardWrtr) oDiscardWrtr.close(); } catch (Exception ignore) {}
             try { if (null!=oBadWrtr) oBadWrtr.close(); } catch (Exception ignore) {}
             try { if (null!=oInBuff) oInBuff.close(); } catch (Exception ignore) {}
             try { if (null!=oInStrm) oInStrm.close(); } catch (Exception ignore) {}
             try { oImplLoad.close(); } catch (Exception ignore) {}
             try { if (bRecoverable) oConn.rollback(); } catch (Exception ignore) {}
             try { oConn.close(); } catch (Exception ignore) {}
             throw new ImportExportException(xcpt.getClass().getName() + " " + xcpt.getMessage() + " at row " + String.valueOf(r));
      }
      catch (java.text.ParseException xcpt) {
            if (DebugFile.trace) DebugFile.writeln("  "+xcpt.getClass().getName()+": at row "+String.valueOf(r)+" "+xcpt.getMessage());
View Full Code Here

            try { if (null!=oDiscardWrtr) oDiscardWrtr.close(); } catch (Exception ignore) {}
            try { if (null!=oBadWrtr) oBadWrtr.close(); } catch (Exception ignore) {}
            try { if (null!=oInBuff) oInBuff.close(); } catch (Exception ignore) {}
            try { if (null!=oInStrm) oInStrm.close(); } catch (Exception ignore) {}
            try { oImplLoad.close(); } catch (Exception ignore) {}
            try { if (bRecoverable) oConn.rollback(); } catch (Exception ignore) {}
            try { oConn.close(); } catch (Exception ignore) {}
            throw new ImportExportException(xcpt.getClass().getName() + " " + xcpt.getMessage() + " at row " + String.valueOf(r));
     }
   } // fi
View Full Code Here

            if (this.realConnection != null) {
                realConnectionHolder = this.realConnection;
                this.realConnection = null;
               
                if (!realConnectionHolder.getAutoCommit())
                    realConnectionHolder.rollback();
            }
        } finally {
            if ((this.datasource != null) && (realConnectionHolder != null)) {
                this.datasource.releaseConnection(this, realConnectionHolder);
                this.datasource = null;
View Full Code Here

        } catch (SQLException ex) {

            if (conn != null) {
                if (!conn.getAutoCommit()) {
                    conn.rollback();
                }
            }

            throw ex;
        }
View Full Code Here

      }
      finally
      {
         if (!success)
         {
            conn.rollback();
         }
         if (stmt != null)
         {
            stmt.close();
         }
View Full Code Here

        dumpTable("trig_test");
        stmt.execute("UPDATE trig_test SET value = 'all done'");
        conn.commit();
        dumpTable("trig_test");
        stmt.execute("DELETE FROM trig_test");
        conn.rollback();
        dumpTable("trig_test");

        try {
            stmt.execute("INSERT INTO trig_test VALUES(11, 'whatever')");
        } catch (SQLException se) {
View Full Code Here

            c.setAutoCommit(false);
            printTable(c, "WAEHLER");
            printTable(c, "TEST");
            doUpdateInsertDeleteWaehler(c);
            c.rollback();

            if (!autocommit) {
                doCreateTableTest(c);
                c.rollback();
            }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.