Package java.sql

Examples of java.sql.PreparedStatement.clearParameters()


        for (CatalogProtos.KeyValueProto entry : table.getMeta().getParams().getKeyvalList()) {
          pstmt.setInt(1, tableId);
          pstmt.setString(2, entry.getKey());
          pstmt.setString(3, entry.getValue());
          pstmt.addBatch();
          pstmt.clearParameters();
        }
        pstmt.executeBatch();
        pstmt.close();
      }
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

                sh.setParameterValuesToStatement(pstmt);
                ResultSet rs = pstmt.executeQuery();
                rs.next();
                count = rs.getInt(1);
                rs.close();
                pstmt.clearParameters();
                pstmt.close();
                releaseConnection(c);
                return count;
            } catch (UnsupportedOperationException e) {
                // Count statement generation not supported
View Full Code Here

                            .getQueryString());
                    sh.setParameterValuesToStatement(pstmt);
                    ResultSet rs = pstmt.executeQuery();
                    contains = rs.next();
                    rs.close();
                    pstmt.clearParameters();
                    pstmt.close();
                    releaseConnection(c);
                    return contains;
                } catch (UnsupportedOperationException e) {
                    // Statement generation not supported, continue...
View Full Code Here

             * transaction and return the new RowId.
             */
            ResultSet generatedKeys = pstmt.getGeneratedKeys();
            RowId newId = getNewRowId(row, generatedKeys);
            generatedKeys.close();
            pstmt.clearParameters();
            pstmt.close();
            commit();
            return newId;
        } else {
            pstmt.clearParameters();
View Full Code Here

            pstmt.clearParameters();
            pstmt.close();
            commit();
            return newId;
        } else {
            pstmt.clearParameters();
            pstmt.close();
            /* On failure return null */
            return null;
        }
    }
View Full Code Here

            debug("DB -> " + sh.getQueryString());
            int retval = pstmt.executeUpdate();
            return retval;
        } finally {
            if (pstmt != null) {
                pstmt.clearParameters();
                pstmt.close();
            }
            if (!transactionOpen) {
                connectionPool.releaseConnection(c);
            }
View Full Code Here

        } finally {
            if (genKeys != null) {
                genKeys.close();
            }
            if (pstmt != null) {
                pstmt.clearParameters();
                pstmt.close();
            }
            if (!transactionOpen) {
                connectionPool.releaseConnection(c);
            }
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.