Java 使用spring的SimpleJDBCall执行存储过程,不给出输出

Java 使用spring的SimpleJDBCall执行存储过程,不给出输出,java,spring,oracle,jdbc,jdbctemplate,Java,Spring,Oracle,Jdbc,Jdbctemplate,这是我的DAO类,它有一个连接到数据库的数据源,并返回以下内容: 2017-03-28 09:49:42 DEBUG DataSourceUtils:327 - Returning JDBC Connection to DataSource 2017-03-28 09:49:42 DEBUG CallMetaDataContext:380 - Using declared parameter for: PRICETOLERANCE_CSR 2017-03-28 09:49:42 DEBUG Si

这是我的DAO类,它有一个连接到数据库的数据源,并返回以下内容:

2017-03-28 09:49:42 DEBUG DataSourceUtils:327 - Returning JDBC Connection to DataSource
2017-03-28 09:49:42 DEBUG CallMetaDataContext:380 - Using declared parameter for: PRICETOLERANCE_CSR
2017-03-28 09:49:42 DEBUG SimpleJdbcCall:313 - Compiled stored procedure. Call string is [{call Z_GETPRICETOLERANCEREJECTS(?)}]
2017-03-28 09:49:42 DEBUG SimpleJdbcCall:289 - SqlCall for procedure [Z_GETPRICETOLERANCEREJECTS] compiled
2017-03-28 09:49:42 DEBUG SimpleJdbcCall:395 - The following parameters are used for call {call Z_GETPRICETOLERANCEREJECTS(?)} with {}
2017-03-28 09:49:42 DEBUG SimpleJdbcCall:398 - 1: priceTolerance_csr, SQL type -10, type name null, parameter class [org.springframework.jdbc.core.SqlOutParameter]
2017-03-28 09:49:42 DEBUG JdbcTemplate:1062 - Calling stored procedure [{call Z_GETPRICETOLERANCEREJECTS(?)}]
2017-03-28 09:49:42 DEBUG DataSourceUtils:110 - Fetching JDBC Connection from DataSource
2017-03-28 09:49:43 DEBUG JdbcTemplate:1136 - CallableStatement.execute() returned 'false'
2017-03-28 09:49:43 DEBUG JdbcTemplate:1137 - CallableStatement.getUpdateCount() returned -1
2017-03-28 09:49:43 DEBUG DataSourceUtils:327 - Returning JDBC Connection to DataSource
2017-03-28 09:49:43 INFO  GenerateReportDaoImpl:59 - [null]
GenerateReportDaoImpl


以下是Price Tolerance Failure Report行映射问题,可能是:存储过程是否实际返回空值?暂时不考虑Java和JDBC,试着在SQL*Plus、SQL Developer或类似的工具中调用存储过程,看看它实际返回了什么。是的,我在SQL Developer中运行了存储过程,它返回结果,但当我在spring中运行它时,我面临着一些问题。使用上述代码井,这很奇怪。为了重现您的问题,我尝试了很多方法,但唯一的方法是如果存储过程实际返回NULL。我唯一的另一个建议是,如果存在这样的问题,或者可能缺少一个或多个Spring库,您应该有一个错误版本的Spring库:我使用的是Spring beans、Spring core、Spring jdbc和Spring tx版本4.2.2,spring数据oracle 1.2.1和spring dao 2.0.8。下面是Price Tolerance Failure Report行映射问题,可能是:存储过程是否实际返回空值?暂时不考虑Java和JDBC,试着在SQL*Plus、SQL Developer或类似的工具中调用存储过程,看看它实际返回了什么。是的,我在SQL Developer中运行了存储过程,它返回结果,但当我在spring中运行它时,我面临着一些问题。使用上述代码井,这很奇怪。为了重现您的问题,我尝试了很多方法,但唯一的方法是如果存储过程实际返回NULL。我唯一的另一个建议是,如果存在这样的问题,或者可能缺少一个或多个Spring库,那么您应该有一个错误版本的Spring库:我使用的是SpringBeans、SpringCore、SpringJDBC和SpringTXVersion4.2.2、SpringDataOracle1.2.1和SpringDAO2.0.8。
@Component
public class GenerateReportDaoImpl {

    private static Logger logger = Logger.getLogger(GenerateReportDaoImpl.class);
    private DataSource dataSource;
    private JdbcTemplate jdbcTemplate = new JdbcTemplate();
    private SimpleJdbcCall jdbcCall;

    public JdbcTemplate getJdbcTemplate() {
        return jdbcTemplate;
    }

    public void setJdbcTemplate(JdbcTemplate jdbcTemplate) {
        this.jdbcTemplate = jdbcTemplate;
    }

    public DataSource getDataSource() {
        return dataSource;
    }

    @Autowired
    public void setDataSource(DataSource dataSource) {
        this.jdbcTemplate = new JdbcTemplate(dataSource);
        this.jdbcCall = new SimpleJdbcCall(dataSource);
    }

    public String getReportEmailFromDB(String lookupCode){
        String sql = "select lookup_description from ussco_lookup_table where lookup_code = ?";
        return jdbcTemplate.queryForObject(sql, new Object[]{lookupCode},String.class);
    }

    public ArrayList<Object> getRecordsFromDatabase(String procedureName) {
        logger.log(Level.INFO,procedureName);
            Map<String, Object> out =  jdbcCall.withProcedureName(procedureName)
                .declareParameters(new SqlOutParameter("priceTolerance_csr", OracleTypes.CURSOR, new PriceToleranceFailureRptRowMapper() )).execute();


        logger.log(Level.INFO,out.values());
        return new ArrayList<>();
    }
}