本文整理汇总了Java中java.sql.CallableStatement.getTimestamp方法的典型用法代码示例。如果您正苦于以下问题:Java CallableStatement.getTimestamp方法的具体用法?Java CallableStatement.getTimestamp怎么用?Java CallableStatement.getTimestamp使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类java.sql.CallableStatement
的用法示例。
在下文中一共展示了CallableStatement.getTimestamp方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getNullableResult
import java.sql.CallableStatement; //导入方法依赖的package包/类
@Override
public Date getNullableResult(CallableStatement cs, int columnIndex) throws SQLException {
Timestamp sqlTimestamp = cs.getTimestamp(columnIndex);
if (sqlTimestamp != null) {
return new Date(sqlTimestamp.getTime());
}
return null;
}
示例2: getResult
import java.sql.CallableStatement; //导入方法依赖的package包/类
public Object getResult(CallableStatement cs, int columnIndex) throws SQLException {
java.sql.Timestamp sqlTimestamp = cs.getTimestamp(columnIndex);
if (cs.wasNull()) {
return null;
}
else {
return new java.util.Date(sqlTimestamp.getTime());
}
}
示例3: getNullableResult
import java.sql.CallableStatement; //导入方法依赖的package包/类
@Override
public Timestamp getNullableResult(CallableStatement cs, int columnIndex) throws SQLException {
return cs.getTimestamp(columnIndex);
}
示例4: 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 {
Timestamp timestamp = cstmt.getTimestamp(parameterIndex);
if (timestamp != null)
return new DateTime(timestamp);
else
return null;
}