本文整理汇总了Java中java.sql.DatabaseMetaData.functionColumnInOut方法的典型用法代码示例。如果您正苦于以下问题:Java DatabaseMetaData.functionColumnInOut方法的具体用法?Java DatabaseMetaData.functionColumnInOut怎么用?Java DatabaseMetaData.functionColumnInOut使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类java.sql.DatabaseMetaData
的用法示例。
在下文中一共展示了DatabaseMetaData.functionColumnInOut方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getFunctionDirection
import java.sql.DatabaseMetaData; //导入方法依赖的package包/类
public static Direction getFunctionDirection(short sqlDirection) {
switch (sqlDirection) {
case DatabaseMetaData.functionColumnOut:
return Direction.OUT;
case DatabaseMetaData.functionColumnInOut:
return Direction.INOUT;
case DatabaseMetaData.functionColumnIn:
return Direction.IN;
default:
LOGGER.log(Level.INFO, "Unknown direction value from DatabaseMetadata.getFunctionColumns(): " + sqlDirection);
return Direction.IN;
}
}
示例2: createProcedureInfo
import java.sql.DatabaseMetaData; //导入方法依赖的package包/类
protected void createProcedureInfo() {
LOGGER.log(Level.FINE, "Initializing procedure info in " + this);
Map<String, Column> newColumns = new LinkedHashMap<String, Column>();
Map<String, Parameter> newParams = new LinkedHashMap<String, Parameter>();
int resultCount = 0;
int paramCount = 0;
try {
ResultSet rs = jdbcSchema.getJDBCCatalog().getJDBCMetadata().getDmd().getFunctionColumns(jdbcSchema.getJDBCCatalog().getName(), jdbcSchema.getName(), name, "%"); // NOI18N
try {
while (rs.next()) {
short columnType = rs.getShort("COLUMN_TYPE");
switch (columnType) {
case DatabaseMetaData.functionColumnResult:
addColumn(++resultCount, rs, newColumns);
break;
case DatabaseMetaData.functionColumnIn:
case DatabaseMetaData.functionColumnInOut:
case DatabaseMetaData.functionColumnOut:
case DatabaseMetaData.functionColumnUnknown:
addParameter(++paramCount, rs, newParams);
break;
case DatabaseMetaData.functionReturn:
setReturnValue(rs);
break;
default:
LOGGER.log(Level.INFO, "Encountered unexpected column type " + columnType + " when retrieving metadadta for procedure " + name);
}
}
} finally {
if (rs != null) {
rs.close();
}
}
} catch (SQLException e) {
throw new MetadataException(e);
}
columns = Collections.unmodifiableMap(newColumns);
parameters = Collections.unmodifiableMap(newParams);
}