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

The following are Jave code examples for showing how to use getDate() 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: DateOnlyTypeHandler.java   Source Code and License Vote up 5 votes
@Override
public Date getNullableResult(CallableStatement cs, int columnIndex) throws SQLException {
	java.sql.Date sqlDate = cs.getDate(columnIndex);
	if (sqlDate != null) {
		return new java.util.Date(sqlDate.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 {

            Object sqlDate = cs.getDate(columnIndex);
            if (cs.wasNull()) {
                return null;
            }
            else {
                return sqlDate;
            }
        }
 
Example 3
Project: tangyuan2   File: SqlDateTypeHandler.java   Source Code and License Vote up 4 votes
@Override
public Date getNullableResult(CallableStatement cs, int columnIndex) throws SQLException {
	return cs.getDate(columnIndex);
}
 
Example 4
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 {
    Date sqlDate = cstmt.getDate(parameterIndex);
    if (sqlDate != null)
        return new DateOnly(sqlDate);
    else
        return null;
}