Meaningless Drivel is fun!*
The moose likes Java in General and the fly likes  :confused: How to call sql cursors in java ??? Urgent Plz. help... Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark " :confused: How to call sql cursors in java ??? Urgent Plz. help..." Watch " :confused: How to call sql cursors in java ??? Urgent Plz. help..." New topic
Author

:confused: How to call sql cursors in java ??? Urgent Plz. help...

VS Prapoorna
Greenhorn

Joined: Oct 13, 2001
Posts: 22
hi all,
Can any body help in getting an idea to call a sql cursor using java code..
i have searched for this but i could not find it.. so plz. help me in this regard asap.
Thanks in advance,
Sarada
Barron Greig
Greenhorn

Joined: Jan 26, 2002
Posts: 8
Assuming you have a Connection object "con", you can create statement, e.g.
PreparedStatement stmt = con.prepareStatement("SELECT * FROM EMPLOYEES");
executing that statement returns a ResultSet which you can then iterate over. I guess the ResultSet is probably using a cursor somewhere deep down in the implementation
ResultSet rs = stmt.executeQuery();
while (rs.next()) {
.. rs.getXXX methods to retrieve field info from
each ResultSet result.
}
VS Prapoorna
Greenhorn

Joined: Oct 13, 2001
Posts: 22
Hi,
i know that
a ResultSet object maintains a cursor pointing to its current row of data. Initially the cursor is positioned before the first row. The next() method moves the cursor to the next row (similar to an iterator or an enumerator in Java).
But my problem is ...when i write a cursor in a database with some name MyCursor.sql i wanted to call that cursor in side my java code .....so this is the actaul problem...i wnt some help from any body.
Thanks in advance,
Sarada
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: :confused: How to call sql cursors in java ??? Urgent Plz. help...
 
Similar Threads
Q on casting
Java JSP Design Issue
Sesion Been
Import CDR File into Sql Database
how to call procedures using jasper report