本文整理匯總了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);
}