How to retrieve data returned from out parameter in hibernate,
In regular connection i can do the following
Code:
StringBuilder hsql = new StringBuilder("call MYSCHEMA.TESTSP(?,?)");
CallableStatement query1 = connecion.prepareCall(hsql.toString());
query1.registerOutParameter(1, Types.CHAR);
query1.registerOutParameter(2, Types.CHAR);
String fileName = "$";
query1.setString(2, "");
query1.setString(1, fileName);
query1.executeUpdate();
String message = query1.getString(2);
I tried
Code:
String message ="";
Session session = sessionFactory.getCurrentSession();
StringBuilder hsql = new StringBuilder("call MYSCHEMA.TESTSP(?,?)");
Query query = session.createSQLQuery(
hsql.toString());
query.setParameter(0, "$");
query.setParameter("message", message);
But message comes out as blank, any ideas