use of org.jkiss.code.NotNull in project dbeaver by serge-rider.
the class DB2MaterializedQueryTableCache method prepareLookupStatement.
@NotNull
@Override
public JDBCStatement prepareLookupStatement(@NotNull JDBCSession session, @NotNull DB2Schema db2Schema, DB2MaterializedQueryTable db2MaterializedQueryTable, String db2MaterializedQueryTableName) throws SQLException {
if (db2MaterializedQueryTable != null || db2MaterializedQueryTableName != null) {
final JDBCPreparedStatement dbStat = session.prepareStatement(SQL_MQT);
dbStat.setString(1, db2Schema.getName());
dbStat.setString(2, db2MaterializedQueryTable != null ? db2MaterializedQueryTable.getName() : db2MaterializedQueryTableName);
return dbStat;
} else {
final JDBCPreparedStatement dbStat = session.prepareStatement(SQL_MQT_ALL);
dbStat.setString(1, db2Schema.getName());
return dbStat;
}
}
use of org.jkiss.code.NotNull 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.code.NotNull 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.code.NotNull in project dbeaver by serge-rider.
the class DB2TableCheckConstraintCache method prepareObjectsStatement.
@NotNull
@Override
protected JDBCStatement prepareObjectsStatement(JDBCSession session, DB2Schema db2Schema, DB2Table forTable) throws SQLException {
String sql;
if (forTable != null) {
sql = SQL_CK_TAB;
} else {
sql = SQL_CK_ALL;
}
JDBCPreparedStatement dbStat = session.prepareStatement(sql);
dbStat.setString(1, db2Schema.getName());
if (forTable != null) {
dbStat.setString(2, forTable.getName());
}
return dbStat;
}
use of org.jkiss.code.NotNull in project dbeaver by serge-rider.
the class DB2TableReferenceCache method prepareObjectsStatement.
@NotNull
@Override
protected JDBCStatement prepareObjectsStatement(JDBCSession session, DB2Schema db2Schema, DB2Table forTable) throws SQLException {
String sql;
if (forTable != null) {
sql = SQL_REF_TAB;
} else {
sql = SQL_REF_ALL;
}
JDBCPreparedStatement dbStat = session.prepareStatement(sql);
dbStat.setString(1, db2Schema.getName());
if (forTable != null) {
dbStat.setString(2, forTable.getName());
}
return dbStat;
}
Aggregations