Package java.sql

Examples of java.sql.PreparedStatement.clearParameters()


               {
                  log.info("STORAGE UPDATE >>>: Property jcr:uuid have to be updated with actual value. Property: "
                     + jcrIdentifier.getPath() + ", actual:" + jcrIdentifier.getNodeIdentifier() + ", existed: "
                     + jcrIdentifier.getJcrIdentifier());

                  update.clearParameters();
                  update.setBinaryStream(1, new ByteArrayInputStream(jcrIdentifier.getNodeIdentifier().getBytes()),
                     jcrIdentifier.getNodeIdentifier().length());
                  update.setString(2, jcrIdentifier.getValueId());

                  if (update.executeUpdate() != 1)
View Full Code Here


               String refPropertyPath = refs.getString("PATH");

               log.info("INSERT REFERENCE >>> Property: " + refPropertyPath + ", " + refPropertyIdentifier + ", "
                  + refOrderNum + "; Node UUID: " + refNodeIdentifier);

               update.clearParameters();
               update.setString(1, refNodeIdentifier);
               update.setString(2, refPropertyIdentifier);
               update.setInt(3, refOrderNum);

               if (update.executeUpdate() != 1)
View Full Code Here

    public void releaseStatement(Statement statement, String sqlString, DatabaseCall call, AbstractSession session) throws SQLException {
        if (call.usesBinding(session) && call.shouldCacheStatement(session)) {
            synchronized (getStatementCache()) {
                PreparedStatement preparedStatement = (PreparedStatement)statement;
                if (!getStatementCache().containsKey(sqlString)) {// May already be there by other thread.
                    preparedStatement.clearParameters();
                    // Bug 5709179 - reset statement settings on cached statements (dminsky) - inclusion of reset
                    resetStatementFromCall(preparedStatement, call);
                    if (getStatementCache().size() > getPlatform().getStatementCacheSize()) {
                        // Currently one is removed at random...
                        PreparedStatement removedStatement = (PreparedStatement)getStatementCache().remove(getStatementCache().keys().nextElement());
View Full Code Here

          {
            insertStatement.executeBatch();
            insertStatement.clearBatch();
          }
         
          insertStatement.clearParameters();
        }
       
        if ((statementCount % this.maxBatchSize) > 0)
        {
          insertStatement.executeBatch();
View Full Code Here

                      insertStatement.clearBatch();
                    }
                  }
                  else if (updateStatement != null) // if (compare == 0)
                  {
                    updateStatement.clearParameters();
                   
                    boolean updated = false;
                   
                    for (int i = primaryKeyColumns.size() + 1; i <= selectColumns.size(); ++i)
                    {
View Full Code Here

        {
          statement.addBatch(TRUNCATE_STATE_SQL);
         
          for (String database: databases)
          {
            statement.clearParameters();
           
            statement.setString(1, database);
           
            statement.addBatch();
          }
View Full Code Here

               {
                  log.info("STORAGE UPDATE >>>: Property jcr:uuid have to be updated with actual value. Property: "
                     + jcrIdentifier.getPath() + ", actual:" + jcrIdentifier.getNodeIdentifier() + ", existed: "
                     + jcrIdentifier.getJcrIdentifier());

                  update.clearParameters();
                  update.setBinaryStream(1, new ByteArrayInputStream(jcrIdentifier.getNodeIdentifier().getBytes()),
                     jcrIdentifier.getNodeIdentifier().length());
                  update.setString(2, jcrIdentifier.getValueId());

                  if (update.executeUpdate() != 1)
View Full Code Here

               String refPropertyPath = refs.getString("PATH");

               log.info("INSERT REFERENCE >>> Property: " + refPropertyPath + ", " + refPropertyIdentifier + ", "
                  + refOrderNum + "; Node UUID: " + refNodeIdentifier);

               update.clearParameters();
               update.setString(1, refNodeIdentifier);
               update.setString(2, refPropertyIdentifier);
               update.setInt(3, refOrderNum);

               if (update.executeUpdate() != 1)
View Full Code Here

            } else {
                pstmt = conn.prepareStatement(getQuery());
            }
            preparedStatementMap.put(getQuery(), pstmt);
        }
        pstmt.clearParameters();
        return pstmt;
    }

    private static void closeAllStatements(Collection collection) {
        Iterator iterator = collection.iterator();
View Full Code Here

            ps = prepareStatement(conn);
            for (JDBCLogAttribute jdbcLogAttribute : messages) {
                int numberOfTries = 2;
                while (numberOfTries > 0) {
                    try {
                        ps.clearParameters();
                        ps.setString(1, jdbcLogAttribute.remoteHost);
                        ps.setString(2, jdbcLogAttribute.user);
                        ps.setTimestamp(3, jdbcLogAttribute.timestamp);
                        ps.setString(4, jdbcLogAttribute.query);
                        ps.setInt(5, jdbcLogAttribute.status);
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.