Java Code Examples for java.sql.CallableStatement.getTimestamp()

The following are Jave code examples for showing how to use getTimestamp() of the java.sql.CallableStatement class. You can vote up the examples you like. Your votes will be used in our system to get more good examples.
Example 1
Project: tangyuan2   File: DateTypeHandler.java   Source Code and License Vote up 5 votes
@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;
}
 
Example 2
Project: uavstack   File: DAOFactory.java   Source Code and License Vote up 5 votes
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());
            }
        }
 
Example 3
Project: uavstack   File: DAOFactory.java   Source Code and License Vote up 5 votes
public Object getResult(CallableStatement cs, int columnIndex) throws SQLException {

            Object sqlTimestamp = cs.getTimestamp(columnIndex);
            if (cs.wasNull()) {
                return null;
            }
            else {
                return sqlTimestamp;
            }
        }
 
Example 4
Project: tangyuan2   File: SqlTimestampTypeHandler.java   Source Code and License Vote up 4 votes
@Override
public Timestamp getNullableResult(CallableStatement cs, int columnIndex) throws SQLException {
	return cs.getTimestamp(columnIndex);
}
 
Example 5
Project: jaffa-framework   File: TypeDefs.java   Source Code and License Vote up 3 votes
/** 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;
}