Package java.sql

Examples of java.sql.Connection.commit()


        // set the users DN locally
        Connection conn3 = ds.getConnection(ldapUser, ldapPassword);
        String tmpString1 = "derby.user." + ldapUser;
        String tmpString2 = "uid=" + ldapUser + ",ou=People,o=" + dnString;
        setDatabaseProperty(tmpString1, tmpString2, conn3);
        conn3.commit();
        // restart to let setting take effect
        JDBCDataSource.setBeanProperty(ds, "shutdownDatabase", "shutdown");
        // shutdown really only happens on next attempt to connect
        try {
            ds.getConnection(ldapUser, ldapPassword);
View Full Code Here


    // cleanup gets a conn using the ldap user & pwd, so we can unset the
    // requireAuthentication so the default teardown & db cleanup can happen
    protected void cleanup(DataSource ds) throws SQLException {
        Connection conn2 = ds.getConnection(ldapUser, ldapPassword);
        setDatabaseProperty("derby.connection.requireAuthentication", "false", conn2);
        conn2.commit();
        JDBCDataSource.setBeanProperty(ds, "shutdownDatabase", "shutdown");
        // shutdown only really happens on attempting to get a connection;
        // this exercise is needed so the DatabasePropertySetup.teardown() can work.
        // Getting a 08006 is not really part of the test, but would be good
        // to be warned of if it happens.
View Full Code Here

            // conn.setAutoCommit(false);

            exportDatabase_worker(dbtype, database, metaData, keySet, conn);

            if (!conn.getAutoCommit()) {
                conn.commit();
                conn.setAutoCommit(true);
            }

            conn.close();
View Full Code Here

            stmt.setString(3,property.getName());
            stmt.setString(4,property.getValueAsString());
           
            count += stmt.executeUpdate();
            stmt.close();
            connection.commit();
           
            if (m_cache != null && count > 0) {
                m_cache.processEvent(new NameValueEvent(m_eventName,source.getURI()));
            }
        }
View Full Code Here

            stmt.setString(2,namespace);
            stmt.setString(3,name);
           
            int count = stmt.executeUpdate();
            stmt.close();
            connection.commit();
           
            if (m_cache != null && count > 0) {
                m_cache.processEvent(new NameValueEvent(m_eventName,source.getURI()));
            }
        }
View Full Code Here

         stmt = conn.createStatement();
         stmt.execute(getDropTableDDL());
         stmt.close();
         stmt = conn.createStatement();
         stmt.execute(getCreateTableDDL());
         conn.commit();
         success = true;
      }
      finally
      {
         if (!success)
View Full Code Here

    Connection c = null;
    PreparedStatement s = null;
    try {
      c = DBImpl.getInstance().getConnection();
      c.setAutoCommit(false);
      c.commit();
      Iterator iter = sql.iterator();
      while (iter.hasNext()) {
        s = c.prepareStatement((String) iter.next());
        s.execute();
      }
View Full Code Here

      Iterator iter = sql.iterator();
      while (iter.hasNext()) {
        s = c.prepareStatement((String) iter.next());
        s.execute();
      }
      c.commit();
    } catch (Exception e) {
      Tracing.logError((s == null ? "n/a" : s.toString()), e, DBJunitImpl.class);
    }
  }
View Full Code Here

         {
            PreparedStatement preparedClearSql = prepareStatement(_conn, getClearSql());
            preparedClearSql.setString(1, getName());
            preparedClearSql.execute();

            _conn.commit();
            success = true;
            exception = null;
            break;
         }
         catch (SQLException e)
View Full Code Here

            if (rst.next())
            {
               size = rst.getInt(1);
            }

            _conn.commit();
            success = true;
            exception = null;
            break;
         }
         catch (SQLException e)
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.