1FUNCTION balance (acct_id NUMBER) RETURN NUMBER IS
2acct_bal NUMBER;
3BEGIN
4SELECT bal INTO acct_bal FROM accts
5WHERE acct_no = acct_id;
6RETURN acct_bal;
7END;
8
9...
10CallableStatement cstmt = conn.prepareCall("{? = CALL balance(?)}");
11cstmt.registerOutParameter(1, Types.FLOAT);
12cstmt.setInt(2, acctNo);
13cstmt.executeUpdate();
14float acctBal = cstmt.getFloat(1);
15...
16