All Downloads are FREE. Search and download functionalities are using the official Maven repository.

tech.ydb.jdbc.context.YdbExecutor Maven / Gradle / Ivy

There is a newer version: 2.3.5
Show newest version
package tech.ydb.jdbc.context;

import java.sql.SQLException;
import java.util.List;

import tech.ydb.jdbc.YdbConst;
import tech.ydb.jdbc.query.ExplainedQuery;
import tech.ydb.table.query.Params;
import tech.ydb.table.result.ResultSetReader;

/**
 *
 * @author Aleksandr Gorshenin
 */
public interface YdbExecutor {
    default void ensureOpened() throws SQLException {
        if (isClosed()) {
            throw new SQLException(YdbConst.CLOSED_CONNECTION);
        }
    }

    boolean isClosed();

    String txID();
    int transactionLevel() throws SQLException;

    boolean isInsideTransaction() throws SQLException;
    boolean isAutoCommit() throws SQLException;
    boolean isReadOnly() throws SQLException;

    void setTransactionLevel(int level) throws SQLException;
    void setReadOnly(boolean readOnly) throws SQLException;
    void setAutoCommit(boolean autoCommit) throws SQLException;

    void executeSchemeQuery(YdbContext ctx, YdbValidator validator, String yql) throws SQLException;

    List executeDataQuery(YdbContext ctx, YdbValidator validator, String yql,
            long timeout, boolean poolable, Params params) throws SQLException;

    ResultSetReader executeScanQuery(YdbContext ctx, YdbValidator validator, String yql, Params params)
            throws SQLException;

    ExplainedQuery executeExplainQuery(YdbContext ctx, YdbValidator validator, String yql)
            throws SQLException;

    void commit(YdbContext ctx, YdbValidator validator) throws SQLException;
    void rollback(YdbContext ctx, YdbValidator validator) throws SQLException;

    boolean isValid(YdbValidator validator, int timeout) throws SQLException;

    void close();
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy