call sql procedure from java
Try this Integer returnValue = (Integer) cs.getObject(1);
after Ebean.execute(cs);
And post it here What it gives ?
Update :Make the follwing changes to your code
Ebean.beginTransaction();
try {
String sql = "call copy_lov_Countries(?)";
CallableSql cs = Ebean.createCallableSql(sql);
cs.registerOut(1, Types.INTEGER);
Ebean.execute(cs);
} finally {
Ebean.endTransaction();
}
Try this:
String sql = "CALL copy_lov_Countries(:param)";
CallableStatement statement = connection.prepareCall(sql);
statement.registerOutParameter("param", Types.INTEGER);
statement.execute();
connection.commit();
The code works with Oracle, should work also with MySQL. The principle is same.