本文整理汇总了Java中java.sql.CallableStatement.wasNull方法的典型用法代码示例。如果您正苦于以下问题:Java CallableStatement.wasNull方法的具体用法?Java CallableStatement.wasNull怎么用?Java CallableStatement.wasNull使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类java.sql.CallableStatement
的用法示例。
在下文中一共展示了CallableStatement.wasNull方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: extract
import java.sql.CallableStatement; //导入方法依赖的package包/类
@Override
public J extract(CallableStatement statement, int index, WrapperOptions options) throws SQLException {
final J value = doExtract( statement, index, options );
final boolean traceEnabled = log.isTraceEnabled();
if ( value == null || statement.wasNull() ) {
if ( traceEnabled ) {
log.tracef(
"extracted procedure output parameter ([%s] : [%s]) - [null]",
index,
JdbcTypeNameMapper.getTypeName( getSqlDescriptor().getSqlType() )
);
}
return null;
}
else {
if ( traceEnabled ) {
log.tracef(
"extracted procedure output parameter ([%s] : [%s]) - [%s]",
index,
JdbcTypeNameMapper.getTypeName( getSqlDescriptor().getSqlType() ),
getJavaDescriptor().extractLoggableRepresentation( value )
);
}
return value;
}
}
示例2: getResult
import java.sql.CallableStatement; //导入方法依赖的package包/类
public Object getResult(CallableStatement cs, int columnIndex) throws SQLException {
Object sqlTime = cs.getTime(columnIndex);
if (cs.wasNull()) {
return null;
}
else {
return sqlTime;
}
}
示例3: getResult
import java.sql.CallableStatement; //导入方法依赖的package包/类
public T getResult(CallableStatement cs, int columnIndex) throws SQLException {
T result = getNullableResult(cs, columnIndex);
if (cs.wasNull()) {
return null;
} else {
return result;
}
}
示例4: getNullableResult
import java.sql.CallableStatement; //导入方法依赖的package包/类
final public S getNullableResult(CallableStatement cs, int columnIndex)
throws SQLException {
T v = delegator.getValue(cs, columnIndex);
if (cs.wasNull()) {
return null;
}
try {
return convertableContext.of(v);
} catch (Exception e) {
throw new SQLException(e.getMessage(), e);
}
}
示例5: getNullableResult
import java.sql.CallableStatement; //导入方法依赖的package包/类
@Override
public Minutes getNullableResult(CallableStatement cs, int columnIndex) throws SQLException {
int minutes = cs.getInt(columnIndex);
return cs.wasNull() ? null : Minutes.of(minutes);
}
示例6: getNullableResult
import java.sql.CallableStatement; //导入方法依赖的package包/类
@Override
public Weeks getNullableResult(CallableStatement cs, int columnIndex) throws SQLException {
int weeks = cs.getInt(columnIndex);
return cs.wasNull() ? null : Weeks.of(weeks);
}
示例7: getNullableResult
import java.sql.CallableStatement; //导入方法依赖的package包/类
@Override
public Hours getNullableResult(CallableStatement cs, int columnIndex) throws SQLException {
int hours = cs.getInt(columnIndex);
return cs.wasNull() ? null : Hours.of(hours);
}
示例8: getNullableResult
import java.sql.CallableStatement; //导入方法依赖的package包/类
@Override
public Months getNullableResult(CallableStatement cs, int columnIndex) throws SQLException {
int months = cs.getInt(columnIndex);
return cs.wasNull() ? null : Months.of(months);
}
示例9: getNullableResult
import java.sql.CallableStatement; //导入方法依赖的package包/类
@Override
public Years getNullableResult(CallableStatement cs, int columnIndex) throws SQLException {
int years = cs.getInt(columnIndex);
return cs.wasNull() ? null : Years.of(years);
}
示例10: getAppObject
import java.sql.CallableStatement; //导入方法依赖的package包/类
/** Gets a parameter from the CallableStatement.
* @return the parameter.
* @param engineType The engine type as defined in init.xml
* @param cstmt The CallableStatement.
* @param parameterIndex The index of the parameter.
* @throws SQLException if a database access error occurs.
* @throws IOException if any error occurs in reading the data from the database.
*/
public Object getAppObject(CallableStatement cstmt, int parameterIndex, String engineType) throws SQLException, IOException {
long value = cstmt.getLong(parameterIndex);
if (cstmt.wasNull())
return null;
else
return new Long(value);
}