// Path: src/main/java/com/github/cassandra/jdbc/CassandraUtils.java
// public static final String CURSOR_PREFIX = "cursor@";


import com.google.common.base.Objects;
import java.sql.Connection;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
import java.util.ArrayList;
import java.util.List;
import static com.github.cassandra.jdbc.CassandraUtils.CURSOR_PREFIX;
/**
 * Copyright (C) 2015-2017, Zhichun Wu
 *
 * Licensed to the Apache Software Foundation (ASF) under one
 * or more contributor license agreements.  See the NOTICE file
 * distributed with this work for additional information
 * regarding copyright ownership.  The ASF licenses this file
 * to you under the Apache License, Version 2.0 (the
 * "License"); you may not use this file except in compliance
 * with the License.  You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing,
 * software distributed under the License is distributed on an
 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
 * KIND, either express or implied.  See the License for the
 * specific language governing permissions and limitations
 * under the License.
 */
package com.github.cassandra.jdbc;




/**
 * This is the base class for all Cassandra statements.
 *
 * @author Zhichun Wu
 */
public abstract class BaseCassandraStatement extends BaseJdbcObject implements Statement {
    private boolean _closeOnCompletion;
    private BaseCassandraConnection _connection;
    private String _cursorName;

    protected final List<CassandraCqlStatement> batch = new ArrayList<CassandraCqlStatement>();
    protected final int concurrency = ResultSet.CONCUR_READ_ONLY;
    protected boolean escapeProcessing = true;
    protected int fetchDirection = ResultSet.FETCH_FORWARD;
    protected int fetchSize = 100;
    protected final int hodability = ResultSet.HOLD_CURSORS_OVER_COMMIT;
    protected int maxFieldSize = 0; // unlimited
    protected int maxRows = 0; // unlimited
    protected boolean poolable = false;
    protected int queryTimeout = 0; // unlimited
    protected final int resultType = ResultSet.TYPE_FORWARD_ONLY;

    protected BaseCassandraStatement(BaseCassandraConnection conn) {
        super(conn == null || conn.quiet);

        _closeOnCompletion = false;
        _connection = conn;
// Path: src/main/java/com/github/cassandra/jdbc/CassandraUtils.java
// public static final String CURSOR_PREFIX = "cursor@";


// Path: src/main/java/com/github/cassandra/jdbc/BaseCassandraStatement.java
import com.google.common.base.Objects;
import java.sql.Connection;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
import java.util.ArrayList;
import java.util.List;
import static com.github.cassandra.jdbc.CassandraUtils.CURSOR_PREFIX;

/**
 * Copyright (C) 2015-2017, Zhichun Wu
 *
 * Licensed to the Apache Software Foundation (ASF) under one
 * or more contributor license agreements.  See the NOTICE file
 * distributed with this work for additional information
 * regarding copyright ownership.  The ASF licenses this file
 * to you under the Apache License, Version 2.0 (the
 * "License"); you may not use this file except in compliance
 * with the License.  You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing,
 * software distributed under the License is distributed on an
 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
 * KIND, either express or implied.  See the License for the
 * specific language governing permissions and limitations
 * under the License.
 */
package com.github.cassandra.jdbc;




/**
 * This is the base class for all Cassandra statements.
 *
 * @author Zhichun Wu
 */
public abstract class BaseCassandraStatement extends BaseJdbcObject implements Statement {
    private boolean _closeOnCompletion;
    private BaseCassandraConnection _connection;
    private String _cursorName;

    protected final List<CassandraCqlStatement> batch = new ArrayList<CassandraCqlStatement>();
    protected final int concurrency = ResultSet.CONCUR_READ_ONLY;
    protected boolean escapeProcessing = true;
    protected int fetchDirection = ResultSet.FETCH_FORWARD;
    protected int fetchSize = 100;
    protected final int hodability = ResultSet.HOLD_CURSORS_OVER_COMMIT;
    protected int maxFieldSize = 0; // unlimited
    protected int maxRows = 0; // unlimited
    protected boolean poolable = false;
    protected int queryTimeout = 0; // unlimited
    protected final int resultType = ResultSet.TYPE_FORWARD_ONLY;

    protected BaseCassandraStatement(BaseCassandraConnection conn) {
        super(conn == null || conn.quiet);

        _closeOnCompletion = false;
        _connection = conn;
        _cursorName = new StringBuilder().append(CURSOR_PREFIX)