Examples of StatementKey


Examples of org.apache.derby.client.am.stmtcache.StatementKey

            throws SQLException {
        // Initial setup.
        final String sql = "values 7";
        java.sql.PreparedStatement ps = prepareStatement(sql);
        JDBCStatementCache cache = new JDBCStatementCache(10);
        StatementKey stmtKey = insertStatementIntoCache(cache, ps, sql);
        LogicalStatementEntity logic =
                createLogicalStatementEntity(sql, false, cache);
        assertSame(ps, logic.getPhysPs());
        assertFalse(logic.isLogicalEntityClosed());
View Full Code Here

Examples of org.apache.derby.client.am.stmtcache.StatementKey

            throws SQLException {
        // Initial setup.
        final String sql = "values 9";
        java.sql.PreparedStatement ps = prepareStatement(sql);
        JDBCStatementCache cache = new JDBCStatementCache(10);
        StatementKey stmtKey = insertStatementIntoCache(cache, ps, sql);
        LogicalStatementEntity logic =
                createLogicalStatementEntity(sql, false, cache);
        assertSame(ps, logic.getPhysPs());
        assertFalse(logic.isLogicalEntityClosed());
View Full Code Here

Examples of org.apache.derby.client.am.stmtcache.StatementKey

        // Create three physical prepares statements.
        java.sql.PreparedStatement ps1 = prepareStatement(sql1);
        java.sql.PreparedStatement ps2 = prepareStatement(sql2);
        java.sql.PreparedStatement ps3 = prepareStatement(sql3);
        // Insert the two first physical statements, the get logical wrappers.
        StatementKey stmtKey1 = insertStatementIntoCache(cache, ps1, sql1);
        StatementKey stmtKey2 = insertStatementIntoCache(cache, ps2, sql2);
        LogicalStatementEntity logic1 =
                createLogicalStatementEntity(sql1, false, cache);
        LogicalStatementEntity logic2 =
                createLogicalStatementEntity(sql2, false, cache);
        // Insert the last physical statement and get the logical wrapper.
        StatementKey stmtKey3 = insertStatementIntoCache(cache, ps3, sql3);
        LogicalStatementEntity logic3 =
                createLogicalStatementEntity(sql3, false, cache);
        assertSame(ps1, logic1.getPhysPs());
        assertSame(ps2, logic2.getPhysPs());
        assertSame(ps3, logic3.getPhysPs());
View Full Code Here

Examples of org.apache.derby.client.am.stmtcache.StatementKey

     */
    private StatementKey insertStatementIntoCache(
                            JDBCStatementCache cache,
                            java.sql.PreparedStatement ps,
                            String sql) throws SQLException {
        StatementKey key;
        if (ps instanceof java.sql.CallableStatement) {
            key = StatementKeyFactory.newCallable(sql, "APP",
                    getConnection().getHoldability());
        } else {
            key = StatementKeyFactory.newPrepared(sql, "APP",
View Full Code Here

Examples of org.apache.derby.client.am.stmtcache.StatementKey

    /**
     * @see java.sql.Connection#prepareStatement(String)
     */
    synchronized PreparedStatement prepareStatement(String sql)
            throws SQLException {
        StatementKey stmtKey = StatementKeyFactory.newPrepared(
                sql, physicalConnection.getCurrentSchemaName(),
                physicalConnection.holdability());
        PreparedStatement ps = cache.getCached(stmtKey);
        if (ps == null) {
            ps = physicalConnection.prepareStatement(sql);
View Full Code Here

Examples of org.apache.derby.client.am.stmtcache.StatementKey

    synchronized PreparedStatement prepareStatement(
                                                String sql,
                                                int resultSetType,
                                                int resultSetConcurrency)
            throws SQLException {
        StatementKey stmtKey = StatementKeyFactory.newPrepared(
                sql, physicalConnection.getCurrentSchemaName(), resultSetType,
                resultSetConcurrency, physicalConnection.holdability());
        PreparedStatement ps = cache.getCached(stmtKey);
        if (ps == null) {
            ps = physicalConnection.prepareStatement(
View Full Code Here

Examples of org.apache.derby.client.am.stmtcache.StatementKey

                                                String sql,
                                                int resultSetType,
                                                int resultSetConcurrency,
                                                int resultSetHoldability)
            throws SQLException {
        StatementKey stmtKey = StatementKeyFactory.newPrepared(
                sql, physicalConnection.getCurrentSchemaName(), resultSetType,
                resultSetConcurrency, resultSetHoldability);

        PreparedStatement ps = cache.getCached(stmtKey);
        if (ps == null) {
View Full Code Here

Examples of org.apache.derby.client.am.stmtcache.StatementKey

     */
    synchronized PreparedStatement prepareStatement(
                                                String sql,
                                                int autoGeneratedKeys)
            throws SQLException {
        StatementKey stmtKey = StatementKeyFactory.newPrepared(
                sql, physicalConnection.getCurrentSchemaName(),
                physicalConnection.getHoldability(), autoGeneratedKeys);
        PreparedStatement ps = cache.getCached(stmtKey);
        if (ps == null) {
            ps = physicalConnection.prepareStatement(sql, autoGeneratedKeys);
View Full Code Here

Examples of org.apache.derby.client.am.stmtcache.StatementKey

    /**
     * @see java.sql.Connection#prepareCall(String)
     */
    synchronized CallableStatement prepareCall(String sql)
            throws SQLException {
        StatementKey stmtKey = StatementKeyFactory.newCallable(
                sql, physicalConnection.getCurrentSchemaName(),
                physicalConnection.holdability());
        CallableStatement cs =
            (CallableStatement)cache.getCached(stmtKey);

View Full Code Here

Examples of org.apache.derby.client.am.stmtcache.StatementKey

     */
    synchronized CallableStatement prepareCall(String sql,
                                                      int resultSetType,
                                                      int resultSetConcurrency)
            throws SQLException {
        StatementKey stmtKey = StatementKeyFactory.newCallable(
                sql, physicalConnection.getCurrentSchemaName(), resultSetType,
                resultSetConcurrency, physicalConnection.holdability());
        CallableStatement cs =
            (CallableStatement)cache.getCached(stmtKey);

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.