use of org.jkiss.dbeaver.model.exec.jdbc.JDBCPreparedStatement in project dbeaver by serge-rider.
the class DB2TablespaceContainerCache method prepareObjectsStatement.
@Override
protected JDBCStatement prepareObjectsStatement(@NotNull JDBCSession session, @NotNull DB2Tablespace ts) throws SQLException {
final JDBCPreparedStatement dbStat = session.prepareStatement(SQL);
dbStat.setInt(1, ts.getTbspaceId());
return dbStat;
}
use of org.jkiss.dbeaver.model.exec.jdbc.JDBCPreparedStatement in project dbeaver by serge-rider.
the class DB2ViewCache method prepareChildrenStatement.
@Override
protected JDBCStatement prepareChildrenStatement(@NotNull JDBCSession session, @NotNull DB2Schema db2Schema, @Nullable DB2View forView) throws SQLException {
String sql;
if (forView != null) {
sql = SQL_COLS_TAB;
} else {
sql = SQL_COLS_ALL;
}
JDBCPreparedStatement dbStat = session.prepareStatement(sql);
dbStat.setString(1, db2Schema.getName());
if (forView != null) {
dbStat.setString(2, forView.getName());
}
return dbStat;
}
use of org.jkiss.dbeaver.model.exec.jdbc.JDBCPreparedStatement in project dbeaver by serge-rider.
the class DB2PlanAnalyser method cleanExplainTables.
// ----------------
// Helpers
// ----------------
private void cleanExplainTables(JDBCSession session, Integer stmtNo, String planTableSchema) throws SQLException {
// Delete previous statement rows
try (JDBCPreparedStatement dbStat = session.prepareStatement(String.format(PT_DELETE, planTableSchema, planTableSchema))) {
dbStat.setInt(1, stmtNo);
dbStat.execute();
}
}
use of org.jkiss.dbeaver.model.exec.jdbc.JDBCPreparedStatement in project dbeaver by serge-rider.
the class DB2AliasCache method prepareObjectsStatement.
@Override
protected JDBCStatement prepareObjectsStatement(@NotNull JDBCSession session, @NotNull DB2Schema db2Schema) throws SQLException {
DB2DataSource db2DataSource = db2Schema.getDataSource();
String sql;
if (db2DataSource.isAtLeastV9_7()) {
sql = SQL_FULL;
} else {
sql = SQL_WITHOUT_MODULE_AND_SEQUALIAS;
}
JDBCPreparedStatement dbStat = session.prepareStatement(sql);
dbStat.setString(1, db2Schema.getName());
if (db2DataSource.isAtLeastV9_7()) {
dbStat.setString(2, db2Schema.getName());
dbStat.setString(3, db2Schema.getName());
}
return dbStat;
}
use of org.jkiss.dbeaver.model.exec.jdbc.JDBCPreparedStatement in project dbeaver by serge-rider.
the class DB2IndexCache method prepareChildrenStatement.
@Override
protected JDBCStatement prepareChildrenStatement(@NotNull JDBCSession session, @NotNull DB2Schema db2Schema, @Nullable DB2Index forIndex) throws SQLException {
JDBCPreparedStatement dbStat = session.prepareStatement(SQL_COLS_IND);
dbStat.setString(1, forIndex.getContainer().getName());
dbStat.setString(2, forIndex.getName());
return dbStat;
}
Aggregations