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

The following are Jave code examples for showing how to use getObject() 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: lams   File: PostgresPlusDialect.java   Source Code and License Vote up 7 votes
@Override
public ResultSet getResultSet(CallableStatement ps) throws SQLException {
	ps.execute();
	return (ResultSet) ps.getObject( 1 );
}
 
Example 2
Project: lams   File: PostgreSQL81Dialect.java   Source Code and License Vote up 7 votes
@Override
public ResultSet getResultSet(CallableStatement ps) throws SQLException {
	ps.execute();
	return (ResultSet) ps.getObject( 1 );
}
 
Example 3
Project: uavstack   File: DAOFactory.java   Source Code and License Vote up 7 votes
public Object getResult(CallableStatement cs, int columnIndex) throws SQLException {

            Object obj = cs.getObject(columnIndex);
            if (cs.wasNull()) {
                return null;
            }
            else {
                return obj;
            }
        }
 
Example 4
Project: spwrap   File: Oracle.java   Source Code and License Vote up 7 votes
public ResultSet getResultSet(CallableStatement statement, int resultSetParamIndex) {
    try {
        return (ResultSet) statement.getObject(resultSetParamIndex);
    } catch (SQLException e) {
        throw new CallException(e);
    }
}
 
Example 5
Project: mybatis-typehandlers-postgis   File: AbstractGeometryTypeHandler.java   Source Code and License Vote up 7 votes
public T getNullableResult(CallableStatement cs, int columnIndex) throws SQLException {
    PGgeometry pGgeometry = (PGgeometry) cs.getObject(columnIndex);
    if (pGgeometry == null) {
        return null;
    }
    return (T) pGgeometry.getGeometry();
}
 
Example 6
Project: lams   File: AbstractParameterRegistrationImpl.java   Source Code and License Vote up 6 votes
@Override
@SuppressWarnings("unchecked")
public T extract(CallableStatement statement) {
	if ( mode == ParameterMode.IN ) {
		throw new ParameterMisuseException( "IN parameter not valid for output extraction" );
	}
	else if ( mode == ParameterMode.REF_CURSOR ) {
		throw new ParameterMisuseException( "REF_CURSOR parameters should be accessed via results" );
	}

	try {
		if ( ProcedureParameterExtractionAware.class.isInstance( hibernateType ) ) {
			return (T) ( (ProcedureParameterExtractionAware) hibernateType ).extract( statement, startIndex, session() );
		}
		else {
			return (T) statement.getObject( startIndex );
		}
	}
	catch (SQLException e) {
		throw procedureCall.getSession().getFactory().getSQLExceptionHelper().convert(
				e,
				"Unable to extract OUT/INOUT parameter value"
		);
	}
}
 
Example 7
Project: lams   File: Oracle8iDialect.java   Source Code and License Vote up 5 votes
@Override
public ResultSet getResultSet(CallableStatement ps) throws SQLException {
	ps.execute();
	return (ResultSet) ps.getObject( 1 );
}
 
Example 8
Project: lams   File: Oracle9Dialect.java   Source Code and License Vote up 5 votes
@Override
public ResultSet getResultSet(CallableStatement ps) throws SQLException {
	ps.execute();
	return (ResultSet) ps.getObject( 1 );
}
 
Example 9
Project: lams   File: Cache71Dialect.java   Source Code and License Vote up 5 votes
@Override
public ResultSet getResultSet(CallableStatement ps) throws SQLException {
	ps.execute();
	return (ResultSet) ps.getObject( 1 );
}
 
Example 10
Project: lams   File: PostgreSQL81Dialect.java   Source Code and License Vote up 5 votes
@Override
public ResultSet getResultSet(CallableStatement statement, int position) throws SQLException {
	if ( position != 1 ) {
		throw new UnsupportedOperationException( "PostgreSQL only supports REF_CURSOR parameters as the first parameter" );
	}
	return (ResultSet) statement.getObject( 1 );
}
 
Example 11
Project: spring-boot-starter-dao   File: GlobalEnumTypeHandler.java   Source Code and License Vote up 5 votes
@Override
public E getNullableResult(CallableStatement cs, int columnIndex) throws SQLException {
	Object s = cs.getObject(columnIndex);
	return this.findObject(s);
}
 
Example 12
Project: tangyuan2   File: ObjectTypeHandler.java   Source Code and License Vote up 5 votes
@Override
public Object getNullableResult(CallableStatement cs, int columnIndex) throws SQLException {
	return cs.getObject(columnIndex);
}
 
Example 13
Project: tangyuan2   File: UnknownTypeHandler.java   Source Code and License Vote up 5 votes
@Override
public Object getNullableResult(CallableStatement cs, int columnIndex) throws SQLException {
	return cs.getObject(columnIndex);
}
 
Example 14
Project: dropwizard-mybatis   File: UUIDObjectTypeHandler.java   Source Code and License Vote up 5 votes
@Override
public UUID getNullableResult(CallableStatement cs, int columnIndex) throws SQLException {
    return (UUID) cs.getObject(columnIndex);
}