Link to home
Start Free TrialLog in
Avatar of krishna kishore mellacheruvu venkata
krishna kishore mellacheruvu venkataFlag for India

asked on

CallabaleStatement and ResultSet

Closing CallableStatement will affect ResultSet?
Avatar of zzynx
zzynx
Flag of Belgium image

If you close your statement, I think your ResultSet becomes unusable
Typical code is:

try {
            XXXStatement statement = getConnection().prepareStatement(...);
            try {
                ...
                ResultSet rs = statement.executeQuery();
                try {
                    while (rs.next()) {
                        ...
                    };
                } finally {
                    rs.close();  // First close your ResultSet
                }
            } finally {
                statement.close();  // then your statement
            }
ASKER CERTIFIED SOLUTION
Avatar of cjjclifford
cjjclifford

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Thanks for the confirmation ;°)
Avatar of cjjclifford
cjjclifford

Argh, forgot to refresh first
:-)
No problem. That way the author can be sure ;°)
melchkishore, imo a points split would have been fair.
Hi, back from vacation today - I'd agree, points split would have been fair.
Cheers,
C.
Thanks cliff.