use of com.cubrid.cubridmanager.core.cubrid.sp.model.SPType in project cubrid-manager by CUBRID.
the class GetSPInfoListTask method buildResult.
/**
* Create sp information list by ResultSet
*
* @throws SQLException the sql exception
*/
private void buildResult() throws SQLException {
// FIXME extract to utility class
while (rs.next()) {
String spName = rs.getString("sp_name");
if (spName == null || spName.trim().length() <= 0) {
continue;
}
String spType = rs.getString("sp_type");
SPType type = null;
if (spType != null && spType.trim().equalsIgnoreCase("PROCEDURE")) {
type = SPType.PROCEDURE;
} else if (spType != null && spType.trim().equalsIgnoreCase("FUNCTION")) {
type = SPType.FUNCTION;
}
String returnType = rs.getString("return_type");
String target = rs.getString("target");
String language = rs.getString("lang");
String owner = rs.getString("owner");
String description = null;
if (isCommentSupport) {
description = rs.getString("comment");
}
SPInfo spInfo = getSPInfo(spInfoList, spName);
if (spInfo == null) {
spInfo = new SPInfo(spName, type, returnType, language, owner, target, description);
spInfoList.add(spInfo);
}
String argName = rs.getString("arg_name");
if (argName == null || argName.trim().length() <= 0) {
continue;
}
// Get sp args
int index = rs.getInt("index_of");
String dataType = rs.getString("data_type");
String mode = rs.getString("mode");
SPArgsType spArgsType = null;
if (mode != null && mode.trim().equalsIgnoreCase("IN")) {
spArgsType = SPArgsType.IN;
} else if (mode != null && mode.trim().equalsIgnoreCase("OUT")) {
spArgsType = SPArgsType.OUT;
} else if (mode != null && mode.trim().equalsIgnoreCase("INOUT")) {
spArgsType = SPArgsType.INOUT;
}
String colDescription = null;
if (isCommentSupport) {
colDescription = rs.getString("col_comment");
}
SPArgsInfo spArgsInfo = new SPArgsInfo(spName, argName, index, dataType, spArgsType, colDescription);
spInfo.addSPArgsInfo(spArgsInfo);
}
}
Aggregations