Examples of executeStmt()


Examples of org.apache.jackrabbit.core.persistence.bundle.util.ConnectionRecoveryManager.executeStmt()

                    tempId, id});
            int count = prep.getUpdateCount();
            if (count == 0) {
                // update count is 0, meaning such a row already exists
                // DELETE FROM DATASTORE WHERE ID=?
                conn.executeStmt(deleteSQL, new Object[]{tempId});
                // SELECT LENGTH, LAST_MODIFIED FROM DATASTORE WHERE ID=?
                prep = conn.executeStmt(selectMetaSQL, new Object[]{id});
                rs = prep.getResultSet();
                if (rs.next()) {
                    long oldLength = rs.getLong(1);
View Full Code Here

Examples of org.apache.jackrabbit.core.persistence.bundle.util.ConnectionRecoveryManager.executeStmt()

            if (count == 0) {
                // update count is 0, meaning such a row already exists
                // DELETE FROM DATASTORE WHERE ID=?
                conn.executeStmt(deleteSQL, new Object[]{tempId});
                // SELECT LENGTH, LAST_MODIFIED FROM DATASTORE WHERE ID=?
                prep = conn.executeStmt(selectMetaSQL, new Object[]{id});
                rs = prep.getResultSet();
                if (rs.next()) {
                    long oldLength = rs.getLong(1);
                    long lastModified = rs.getLong(2);
                    if (oldLength != length) {
View Full Code Here

Examples of org.apache.jackrabbit.core.persistence.bundle.util.ConnectionRecoveryManager.executeStmt()

                if (identifier != null) {
                    touch(identifier, 0);
                }
            }
            // DELETE FROM DATASTORE WHERE LAST_MODIFIED<?
            PreparedStatement prep = conn.executeStmt(deleteOlderSQL, new Long[]{new Long(min)});
            return prep.getUpdateCount();
        } catch (Exception e) {
            throw convert("Can not delete records", e);
        } finally {
            putBack(conn);
View Full Code Here

Examples of org.apache.jackrabbit.core.persistence.bundle.util.ConnectionRecoveryManager.executeStmt()

        ConnectionRecoveryManager conn = getConnection();
        ArrayList list = new ArrayList();
        ResultSet rs = null;
        try {
            // SELECT ID FROM DATASTORE
            PreparedStatement prep = conn.executeStmt(selectAllSQL, new Object[0]);
            rs = prep.getResultSet();
            while (rs.next()) {
                String id = rs.getString(1);
                if (!id.startsWith(TEMP_PREFIX)) {
                    DataIdentifier identifier = new DataIdentifier(id);
View Full Code Here

Examples of org.apache.jackrabbit.core.persistence.bundle.util.ConnectionRecoveryManager.executeStmt()

        usesIdentifier(identifier);
        ResultSet rs = null;
        try {
            String id = identifier.toString();
            // SELECT LENGTH, LAST_MODIFIED FROM DATASTORE WHERE ID = ?
            PreparedStatement prep = conn.executeStmt(selectMetaSQL, new Object[]{id});
            rs = prep.getResultSet();
            if (!rs.next()) {
                throw new DataStoreException("Record not found: " + identifier);
            }
            long length = rs.getLong(1);
View Full Code Here

Examples of org.apache.jackrabbit.core.persistence.bundle.util.ConnectionRecoveryManager.executeStmt()

            meta.getDriverVersion();
            ResultSet rs = meta.getTables(null, null, tableSQL, null);
            boolean exists = rs.next();
            rs.close();
            if (!exists) {
                conn.executeStmt(createTableSQL, null);
            }
            putBack(conn);
        } catch (Exception e) {
            throw convert("Can not init data store, driver=" + driver + " url=" + url + " user=" + user, e);
        }
View Full Code Here

Examples of org.apache.jackrabbit.core.persistence.bundle.util.ConnectionRecoveryManager.executeStmt()

            long now = System.currentTimeMillis();
            Long n = new Long(now);
            ConnectionRecoveryManager conn = getConnection();
            try {
                // UPDATE DATASTORE SET LAST_MODIFIED = ? WHERE ID = ? AND LAST_MODIFIED < ?
                conn.executeStmt(updateLastModifiedSQL, new Object[]{
                        n, identifier.toString(), n
                });
                return now;
            } catch (Exception e) {
                throw convert("Can not update lastModified", e);
View Full Code Here

Examples of org.apache.jackrabbit.core.persistence.bundle.util.ConnectionRecoveryManager.executeStmt()

    public InputStream getInputStream(DataIdentifier identifier) throws DataStoreException {
        ConnectionRecoveryManager conn = getConnection();
        try {
            String id = identifier.toString();
            // SELECT ID, DATA FROM DATASTORE WHERE ID = ?
            PreparedStatement prep = conn.executeStmt(selectDataSQL, new Object[]{id});
            ResultSet rs = prep.getResultSet();
            if (!rs.next()) {
                throw new DataStoreException("Record not found: " + identifier);
            }
            InputStream in = new BufferedInputStream(rs.getBinaryStream(2));
View Full Code Here

Examples of org.apache.jackrabbit.core.persistence.bundle.util.ConnectionRecoveryManager.executeStmt()

                try {
                    now = System.currentTimeMillis();
                    id = UUID.randomUUID().toString();
                    tempId = TEMP_PREFIX + id;
                    // SELECT LENGTH, LAST_MODIFIED FROM DATASTORE WHERE ID=?
                    PreparedStatement prep = conn.executeStmt(selectMetaSQL, new Object[]{tempId});
                    rs = prep.getResultSet();
                    if (rs.next()) {
                        // re-try in the very, very unlikely event that the row already exists
                        continue;
                    }
View Full Code Here

Examples of org.apache.jackrabbit.core.persistence.bundle.util.ConnectionRecoveryManager.executeStmt()

                    if (rs.next()) {
                        // re-try in the very, very unlikely event that the row already exists
                        continue;
                    }
                    // INSERT INTO DATASTORE VALUES(?, 0, ?, NULL)
                    conn.executeStmt(insertTempSQL, new Object[]{tempId, new Long(now)});
                    break;
                } catch (Exception e) {
                    throw convert("Can not insert new record", e);
                } finally {
                    DatabaseHelper.closeSilently(rs);
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.