use of org.jkiss.dbeaver.model.struct.rdb.DBSProcedureParameter in project dbeaver by serge-rider.
the class JDBCCallableStatementImpl method getResultSet.
@Nullable
@Override
public JDBCResultSet getResultSet() throws SQLException {
JDBCResultSet resultSet = makeResultSet(getOriginal().getResultSet());
if (resultSet == null && procedure != null) {
JDBCResultSetCallable procResults = new JDBCResultSetCallable(getConnection(), this);
try {
Collection<? extends DBSProcedureParameter> params = procedure.getParameters(getConnection().getProgressMonitor());
if (!CommonUtils.isEmpty(params)) {
for (DBSProcedureParameter param : params) {
if (param.getParameterKind() == DBSProcedureParameterKind.OUT || param.getParameterKind() == DBSProcedureParameterKind.INOUT) {
procResults.addColumn(param.getName(), param.getParameterType());
}
}
}
} catch (DBException e) {
log.warn("Error extracting callable results", e);
}
procResults.addRow();
return procResults;
}
return resultSet;
}
use of org.jkiss.dbeaver.model.struct.rdb.DBSProcedureParameter in project dbeaver by serge-rider.
the class JDBCCallableStatementImpl method bindProcedureFromMeta.
void bindProcedureFromMeta() throws DBException {
if (procedure == null) {
return;
}
try {
Collection<? extends DBSProcedureParameter> params = procedure.getParameters(getConnection().getProgressMonitor());
if (!CommonUtils.isEmpty(params)) {
int index = 0;
for (DBSProcedureParameter param : params) {
if (param.getParameterKind() == DBSProcedureParameterKind.OUT || param.getParameterKind() == DBSProcedureParameterKind.INOUT) {
index++;
registerOutParameter(index, param.getParameterType().getTypeID());
}
}
}
} catch (SQLException e) {
throw new DBException("Error binding callable statement parameters", e);
}
}
Aggregations