+ "."
+ columnName);
continue;
}
ProcedureParameter column = new ProcedureParameter(columnName);
if (columnName == null) {
if (type == DatabaseMetaData.procedureColumnReturn) {
logObj.debug("null column name, assuming result column: " + key);
column.setName("_return_value");
}
else {
logObj.info("invalid null column name, skipping column : " + key);
continue;
}
}
int columnType = columnsRS.getInt("DATA_TYPE");
int columnSize = columnsRS.getInt("LENGTH");
// ignore precision of non-decimal columns
int decimalDigits = -1;
if (TypesMapping.isDecimal(columnType)) {
decimalDigits = columnsRS.getShort("SCALE");
if (columnsRS.wasNull()) {
decimalDigits = -1;
}
}
switch (type) {
case DatabaseMetaData.procedureColumnIn:
column.setDirection(ProcedureParameter.IN_PARAMETER);
break;
case DatabaseMetaData.procedureColumnInOut:
column.setDirection(ProcedureParameter.IN_OUT_PARAMETER);
break;
case DatabaseMetaData.procedureColumnOut:
column.setDirection(ProcedureParameter.OUT_PARAMETER);
break;
case DatabaseMetaData.procedureColumnReturn:
procedure.setReturningValue(true);
break;
}
column.setMaxLength(columnSize);
column.setPrecision(decimalDigits);
column.setProcedure(procedure);
column.setType(columnType);
procedure.addCallParameter(column);
}
}
finally {
columnsRS.close();