java - Calling stored procedure with cursor via jdbc -
i have table employee having (id,name,age); made stored procedure as-
set serveroutput on create or replace procedure empprocc(c1 out sys_refcursor) begin open c1 select name employee; end;
//the above stored procedure working fine below 2 lines.
variable c2 refcursor; print :c2
but when writing servlet not working....
callablestatement csstatement=con.preparecall("{call empprocc(?)}"); csstatement.registeroutparameter(1,java.sql.types.ref_cursor); csstatement.executeupdate(); rs=(resultset) csstatement.getobject(1); while(rs.next()) response.getwriter().println(" "+rs.getstring("name"));
i saw tutorials using oracle.types.cursors...but not able use it..not able import oracle.jdbc.types;
Comments
Post a Comment