I have a PL/SQL procedure that SELECTs lists of data from several tables. I want to be able to use this with JSP. I've read about people using CURSORS to retrieve multiple tuples from database queries. I'm new to cursors and callableStatements.
Can someone please walk me through (examples would be nice) this process?
My procedure is fairly basic. I give it a userID and/or location that are used in the WHERE clause and it will list all the information for that user and/or location.
I think this is how it's supposed to be done-> but I'm not positive:
callableStatement cs = con.prepareCall ( "{ call myProc ( ?,?, ? )}" );
cs.registerOutParameter( 1, CURSOR );
cs.setString( 2, uNum );
cs.setString( 3, location );
cs.execute();
resultSet rs = cs...?
while( rs.next() ) {
//List data
}
Is this right?
Can someone please walk me through (examples would be nice) this process?
My procedure is fairly basic. I give it a userID and/or location that are used in the WHERE clause and it will list all the information for that user and/or location.
I think this is how it's supposed to be done-> but I'm not positive:
callableStatement cs = con.prepareCall ( "{ call myProc ( ?,?, ? )}" );
cs.registerOutParameter( 1, CURSOR );
cs.setString( 2, uNum );
cs.setString( 3, location );
cs.execute();
resultSet rs = cs...?
while( rs.next() ) {
//List data
}
Is this right?