Java 类org.springframework.jdbc.core.SqlReturnResultSet 实例源码

项目:lams    文件:CallMetaDataContext.java   
/**
 * Create a ReturnResultSetParameter/SqlOutParameter depending on the support provided
 * by the JDBC driver used for the database in use.
 * @param parameterName the name of the parameter (also used as the name of the List returned in the output)
 * @param rowMapper a RowMapper implementation used to map the data returned in the result set
 * @return the appropriate SqlParameter
 */
public SqlParameter createReturnResultSetParameter(String parameterName, RowMapper<?> rowMapper) {
    if (this.metaDataProvider.isReturnResultSetSupported()) {
        return new SqlReturnResultSet(parameterName, rowMapper);
    }
    else {
        if (this.metaDataProvider.isRefCursorSupported()) {
            return new SqlOutParameter(parameterName, this.metaDataProvider.getRefCursorSqlType(), rowMapper);
        }
        else {
            throw new InvalidDataAccessApiUsageException("Return of a ResultSet from a stored procedure is not supported.");
        }
    }
}
项目:spring4-understanding    文件:CallMetaDataContext.java   
/**
 * Create a ReturnResultSetParameter/SqlOutParameter depending on the support provided
 * by the JDBC driver used for the database in use.
 * @param parameterName the name of the parameter (also used as the name of the List returned in the output)
 * @param rowMapper a RowMapper implementation used to map the data returned in the result set
 * @return the appropriate SqlParameter
 */
public SqlParameter createReturnResultSetParameter(String parameterName, RowMapper<?> rowMapper) {
    if (this.metaDataProvider.isReturnResultSetSupported()) {
        return new SqlReturnResultSet(parameterName, rowMapper);
    }
    else {
        if (this.metaDataProvider.isRefCursorSupported()) {
            return new SqlOutParameter(parameterName, this.metaDataProvider.getRefCursorSqlType(), rowMapper);
        }
        else {
            throw new InvalidDataAccessApiUsageException("Return of a ResultSet from a stored procedure is not supported.");
        }
    }
}
项目:class-guard    文件:CallMetaDataContext.java   
/**
 * Create a ReturnResultSetParameter/SqlOutParameter depending on the support provided
 * by the JDBC driver used for the database in use.
 * @param parameterName the name of the parameter (also used as the name of the List returned in the output)
 * @param rowMapper a RowMapper implementation used to map the data returned in the result set
 * @return the appropriate SqlParameter
 */
public SqlParameter createReturnResultSetParameter(String parameterName, RowMapper rowMapper) {
    if (this.metaDataProvider.isReturnResultSetSupported()) {
        return new SqlReturnResultSet(parameterName, rowMapper);
    }
    else {
        if (this.metaDataProvider.isRefCursorSupported()) {
            return new SqlOutParameter(parameterName, this.metaDataProvider.getRefCursorSqlType(), rowMapper);
        }
        else {
            throw new InvalidDataAccessApiUsageException("Return of a ResultSet from a stored procedure is not supported.");
        }
    }
}
项目:spring4-understanding    文件:StoredProcedureTests.java   
public StoredProcedureWithResultSet(DataSource ds) {
    setDataSource(ds);
    setSql(SQL);
    declareParameter(new SqlReturnResultSet("rs", this.handler));
    compile();
}
项目:spring4-understanding    文件:StoredProcedureTests.java   
public StoredProcedureWithResultSetMapped(DataSource ds) {
    setDataSource(ds);
    setSql(SQL);
    declareParameter(new SqlReturnResultSet("rs", new RowMapperImpl()));
    compile();
}
项目:spring4-understanding    文件:StoredProcedureTests.java   
public StoredProcedureWithResultSetMapped(JdbcTemplate jt) {
    setJdbcTemplate(jt);
    setSql(SQL);
    declareParameter(new SqlReturnResultSet("rs", new RowMapperImpl()));
    compile();
}
项目:class-guard    文件:StoredProcedureTests.java   
public StoredProcedureWithResultSet(DataSource ds) {
    setDataSource(ds);
    setSql(SQL);
    declareParameter(new SqlReturnResultSet("rs", this.handler));
    compile();
}
项目:class-guard    文件:StoredProcedureTests.java   
public StoredProcedureWithResultSetMapped(DataSource ds) {
    setDataSource(ds);
    setSql(SQL);
    declareParameter(new SqlReturnResultSet("rs", new RowMapperImpl()));
    compile();
}
项目:class-guard    文件:StoredProcedureTests.java   
public StoredProcedureWithResultSetMapped(JdbcTemplate jt) {
    setJdbcTemplate(jt);
    setSql(SQL);
    declareParameter(new SqlReturnResultSet("rs", new RowMapperImpl()));
    compile();
}