1

What is the type of IS TABLE OF NUMBER(5) INDEX BY BINARY_INTEGER in Java? OracleTypes.ARRAY gives an ORA-03115 exception.

Update: The whole class:

@Repository
public class MerchantEmvRepository {
    private SimpleJdbcCall updateMerchantEmvTerminalData;

    DataSource dataSource;

    @Autowired
    public MerchantEmvRepository (DataSource dataSource) {
        this.dataSource = dataSource;
    }

    @Autowired
    public void setDataSource (){
        JdbcTemplate jdbcTemplate = new JdbcTemplate(dataSource);
        jdbcTemplate.setResultsMapCaseInsensitive(true);
        this.updateMerchantEmvTerminalData
                = new SimpleJdbcCall(jdbcTemplate)
                .declareParameters(new SqlOutParameter("RetCodeType", OracleTypes.ARRAY))
                .withCatalogName("data")
                .withoutProcedureColumnMetaDataAccess()
                .withFunctionName("update_merch_emv");
    }

    public Array updateMerchantEmvTerminalData (String merchantId) {
        SqlParameterSource incomingParameters = new MapSqlParameterSource().addValue("i_merch_id", merchantId);
        return updateMerchantEmvTerminalData.executeFunction(Array.class, incomingParameters);
    }
}
2
  • 3
    can you show us the code which provide this error please? Commented Feb 6, 2018 at 11:01
  • @YCF_L updated the initial post. Commented Feb 6, 2018 at 11:19

1 Answer 1

2

There is no such type. Using oracle associative array from java is very limit. There are 4 methods in OraclePreparedStatement/OracleCallableStatement classes which allow for this. https://docs.oracle.com/database/121/JJDBC/oraint.htm#JJDBC28179.

Documentation is for oracle 12 but it also should work in oracle 9+

Sign up to request clarification or add additional context in comments.

1 Comment

Could you include the methods in your answer. Link can die, future people finding your answer could not get the same content... See How to Answer about links

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.