--
You received this message because you are subscribed to the Google Groups "H2 Database" group.
To unsubscribe from this group and stop receiving emails from it, send an email to h2-database...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/h2-database/92fde29d-e26e-4816-b752-d7e568b971c1n%40googlegroups.com.
try (Connection c = DriverManager.getConnection("jdbc:h2:mem:1")) {
Statement s = c.createStatement();
s.execute("CREATE ALIAS my_stored_proc AS 'BigDecimal send() { return BigDecimal.ONE; }'");
// With PreparedStatement
PreparedStatement ps = c.prepareStatement("CALL my_stored_proc()");
ResultSet rs = ps.executeQuery();
rs.next();
System.out.println(rs.getBigDecimal(1));
// With CallableStatement
CallableStatement cs = c.prepareCall("{? = CALL my_stored_proc()}");
cs.registerOutParameter(1, Types.NUMERIC);
cs.execute();
System.out.println(cs.getBigDecimal(1));
}
--
You received this message because you are subscribed to the Google Groups "H2 Database" group.
To unsubscribe from this group and stop receiving emails from it, send an email to h2-database...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/h2-database/927ea4e9-60d0-41ad-b186-95202b3bdcfan%40googlegroups.com.