Search in sources :

Example 1 with JDBCStatementImpl

use of org.jkiss.dbeaver.model.impl.jdbc.exec.JDBCStatementImpl in project dbeaver by serge-rider.

the class ExasolTableCache method prepareChildrenStatement.

@SuppressWarnings("rawtypes")
@Override
protected JDBCStatement prepareChildrenStatement(@NotNull JDBCSession session, @NotNull ExasolSchema exasolSchema, @Nullable ExasolTable exasolTable) throws SQLException {
    String sql;
    if (exasolTable != null)
        sql = String.format(SQL_COLS_TAB, ExasolUtils.quoteString(exasolSchema.getName()), ExasolUtils.quoteString(exasolTable.getName()));
    else
        sql = String.format(SQL_COLS_ALL, ExasolUtils.quoteString(exasolSchema.getName()));
    JDBCStatement dbstat = session.createStatement();
    ((JDBCStatementImpl) dbstat).setQueryString(sql);
    return dbstat;
}
Also used : JDBCStatement(org.jkiss.dbeaver.model.exec.jdbc.JDBCStatement) JDBCStatementImpl(org.jkiss.dbeaver.model.impl.jdbc.exec.JDBCStatementImpl)

Example 2 with JDBCStatementImpl

use of org.jkiss.dbeaver.model.impl.jdbc.exec.JDBCStatementImpl in project dbeaver by serge-rider.

the class ExasolTableUniqueKeyCache method prepareObjectsStatement.

@SuppressWarnings("rawtypes")
@NotNull
@Override
protected JDBCStatement prepareObjectsStatement(JDBCSession session, ExasolSchema exasolSchema, ExasolTable forTable) throws SQLException {
    String sql;
    if (forTable != null) {
        sql = String.format(SQL_UK_TAB, ExasolUtils.quoteString(exasolSchema.getName()), ExasolUtils.quoteString(forTable.getName()));
    } else {
        sql = String.format(SQL_UK_ALL, ExasolUtils.quoteString(exasolSchema.getName()));
    }
    JDBCStatement dbStat = session.createStatement();
    ((JDBCStatementImpl) dbStat).setQueryString(sql);
    return dbStat;
}
Also used : JDBCStatement(org.jkiss.dbeaver.model.exec.jdbc.JDBCStatement) JDBCStatementImpl(org.jkiss.dbeaver.model.impl.jdbc.exec.JDBCStatementImpl) NotNull(org.jkiss.code.NotNull)

Example 3 with JDBCStatementImpl

use of org.jkiss.dbeaver.model.impl.jdbc.exec.JDBCStatementImpl in project dbeaver by serge-rider.

the class ExasolJDBCObjectSimpleCacheLiterals method prepareObjectsStatement.

@SuppressWarnings("rawtypes")
@Override
protected JDBCStatement prepareObjectsStatement(@NotNull JDBCSession session, @NotNull OWNER owner) throws SQLException {
    JDBCStatement dbStat = session.createStatement();
    //escape parameters
    for (int i = 0; i < queryParameters.length; i++) {
        queryParameters[i] = (Object) ExasolUtils.quoteString(queryParameters[i].toString());
    }
    executeQuery = String.format(query, queryParameters);
    ((JDBCStatementImpl) dbStat).setQueryString(executeQuery);
    return dbStat;
}
Also used : JDBCStatement(org.jkiss.dbeaver.model.exec.jdbc.JDBCStatement) JDBCStatementImpl(org.jkiss.dbeaver.model.impl.jdbc.exec.JDBCStatementImpl)

Example 4 with JDBCStatementImpl

use of org.jkiss.dbeaver.model.impl.jdbc.exec.JDBCStatementImpl in project dbeaver by serge-rider.

the class ExasolTableForeignKeyCache method prepareObjectsStatement.

@SuppressWarnings("rawtypes")
@NotNull
@Override
protected JDBCStatement prepareObjectsStatement(JDBCSession session, ExasolSchema exasolSchema, ExasolTable forTable) throws SQLException {
    String sql;
    if (forTable != null) {
        sql = String.format(SQL_FK_TAB, ExasolUtils.quoteString(exasolSchema.getName()), ExasolUtils.quoteString(forTable.getName()));
    } else {
        sql = String.format(SQL_FK_ALL, ExasolUtils.quoteString(exasolSchema.getName()));
    }
    JDBCStatement dbStat = session.createStatement();
    ((JDBCStatementImpl) dbStat).setQueryString(sql);
    return dbStat;
}
Also used : JDBCStatement(org.jkiss.dbeaver.model.exec.jdbc.JDBCStatement) JDBCStatementImpl(org.jkiss.dbeaver.model.impl.jdbc.exec.JDBCStatementImpl) NotNull(org.jkiss.code.NotNull)

Example 5 with JDBCStatementImpl

use of org.jkiss.dbeaver.model.impl.jdbc.exec.JDBCStatementImpl in project dbeaver by serge-rider.

the class ExasolViewCache method prepareObjectsStatement.

@SuppressWarnings("rawtypes")
@Override
protected JDBCStatement prepareObjectsStatement(@NotNull JDBCSession session, @NotNull ExasolSchema exasolSchema) throws SQLException {
    JDBCStatement dbStat = session.createStatement();
    String sql = String.format(SQL_VIEWS, ExasolUtils.quoteString(exasolSchema.getName()), ExasolUtils.quoteString(exasolSchema.getName()));
    ((JDBCStatementImpl) dbStat).setQueryString(sql);
    return dbStat;
}
Also used : JDBCStatement(org.jkiss.dbeaver.model.exec.jdbc.JDBCStatement) JDBCStatementImpl(org.jkiss.dbeaver.model.impl.jdbc.exec.JDBCStatementImpl)

Aggregations

JDBCStatement (org.jkiss.dbeaver.model.exec.jdbc.JDBCStatement)6 JDBCStatementImpl (org.jkiss.dbeaver.model.impl.jdbc.exec.JDBCStatementImpl)6 NotNull (org.jkiss.code.NotNull)2