Saturday, February 3, 2007

How to get the resultset of stored Procedure ?

a. By invoking the getObject on the CallableStatement.CallableStatement
proc = conn.prepareCall("{ ? = call " + functionSql + "
}");proc.registerOutParameter(1, Types.OTHER); proc.execute();ResultSet results =
(ResultSet) proc.getObject(1);

b. Involve getResultSet() method of the callableStatement object that is
inherited from java.sql.Statement interface.

SOURCE : www.referjava.com

No comments: