use of org.jkiss.dbeaver.model.exec.jdbc.JDBCPreparedStatement in project dbeaver by serge-rider.
the class DB2NicknameCache method prepareLookupStatement.
@NotNull
@Override
public JDBCStatement prepareLookupStatement(@NotNull JDBCSession session, @NotNull DB2Schema db2Schema, DB2Nickname db2Nickname, String db2NicknameName) throws SQLException {
if (db2Nickname != null || db2NicknameName != null) {
final JDBCPreparedStatement dbStat = session.prepareStatement(SQL_NICK);
dbStat.setString(1, db2Schema.getName());
dbStat.setString(2, db2Nickname != null ? db2Nickname.getName() : db2NicknameName);
return dbStat;
} else {
final JDBCPreparedStatement dbStat = session.prepareStatement(SQL_NICK_ALL);
dbStat.setString(1, db2Schema.getName());
return dbStat;
}
}
use of org.jkiss.dbeaver.model.exec.jdbc.JDBCPreparedStatement in project dbeaver by serge-rider.
the class DB2RoutineCache method prepareObjectsStatement.
@Override
protected JDBCStatement prepareObjectsStatement(@NotNull JDBCSession session, @NotNull DB2Schema db2Schema) throws SQLException {
String sql;
if (db2Schema.getDataSource().isAtLeastV9_7()) {
sql = SQL_ALL;
} else {
sql = SQL_V95;
}
JDBCPreparedStatement dbStat = session.prepareStatement(sql);
dbStat.setString(1, db2Schema.getName());
return dbStat;
}
use of org.jkiss.dbeaver.model.exec.jdbc.JDBCPreparedStatement in project dbeaver by serge-rider.
the class DB2RoutineParmsCache method prepareObjectsStatement.
@Override
protected JDBCStatement prepareObjectsStatement(@NotNull JDBCSession session, @NotNull DB2Routine db2Routine) throws SQLException {
JDBCPreparedStatement dbStat = session.prepareStatement(SQL);
dbStat.setString(1, db2Routine.getSchema().getName());
dbStat.setString(2, db2Routine.getUniqueName());
return dbStat;
}
use of org.jkiss.dbeaver.model.exec.jdbc.JDBCPreparedStatement in project dbeaver by serge-rider.
the class DB2TableCache method prepareLookupStatement.
@NotNull
@Override
public JDBCStatement prepareLookupStatement(@NotNull JDBCSession session, @NotNull DB2Schema db2Schema, @Nullable DB2Table db2Table, @Nullable String db2TableName) throws SQLException {
if (db2Table != null || db2TableName != null) {
final JDBCPreparedStatement dbStat = session.prepareStatement(SQL_TAB);
dbStat.setString(1, db2Schema.getName());
dbStat.setString(2, db2Table != null ? db2Table.getName() : db2TableName);
return dbStat;
} else {
final JDBCPreparedStatement dbStat = session.prepareStatement(SQL_TAB_ALL);
dbStat.setString(1, db2Schema.getName());
return dbStat;
}
}
use of org.jkiss.dbeaver.model.exec.jdbc.JDBCPreparedStatement in project dbeaver by serge-rider.
the class DB2TableCache method prepareChildrenStatement.
@Override
protected JDBCStatement prepareChildrenStatement(@NotNull JDBCSession session, @NotNull DB2Schema db2Schema, @Nullable DB2Table forTable) throws SQLException {
String sql;
if (forTable != null) {
sql = SQL_COLS_TAB;
} else {
sql = SQL_COLS_ALL;
}
JDBCPreparedStatement dbStat = session.prepareStatement(sql);
dbStat.setString(1, db2Schema.getName());
if (forTable != null) {
dbStat.setString(2, forTable.getName());
}
return dbStat;
}
Aggregations