0

My app is calling Oracle DB using Spring data JPA, and one of the operations is calling a Stored Procedure.

When it come to integration testing, I'm using H2 DB, but I found difficulties to call the SP.

Below is the way I'm calling the SP

final StoredProcedureQuery query = entityManager
            .createStoredProcedureQuery("MY_SP_HERE")
            .registerStoredProcedureParameter("PARAM_1", String.class, ParameterMode.IN)
            .setParameter("PARAM_1", "VALUE_PARAM_1")
            .registerStoredProcedureParameter("V_CURSOR_OUT", CustomClass.class,
                    ParameterMode.REF_CURSOR);

query.execute();

final List<Object[]> obj = query.getResultList();

Is it possible to call the SP from H2 ?

Gerry Gry
  • 182
  • 5
  • 17
  • https://stackoverflow.com/questions/11718865/stored-procedure-in-h2-database#:~:text=There%20is%20no%20stored%20procedure,call%20that%20methods%20using%20alias. check out this post – mckszcz Jun 26 '20 at 12:09
  • @mckszcz meaning, there's no way i can do integration testing using H2 with that code ? – Gerry Gry Jun 26 '20 at 12:13
  • That's correct, H2 doesn't implement stored procedures. – Nathan Hughes Jun 26 '20 at 12:37

0 Answers0