Jul 19, 2010 2:30 PM
Not able to make netezza result set scrollable.
-
Like (0)
Hi ,
Does Netezza support "TYPE_SCROLL_INSENSITIVE" result set type.? If so how?
I am trying to fetch resultset as follows:
ResultSet rs=conn.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE,
ResultSet.CONCUR_UPDATABLE).executeQuery(sqlQuery);
The resultSet I am getting back is 1003 (TYPE_FORWARD_ONLY) not 1005 (TYPE_SCROLL_INSENSITIVE).
If I use rs.beforeFirst() ,it's throwing me an error.
org.netezza.util.PSQLException: ResultSet is TYPE_FORWARD_ONLY
I am using JDBC driver 4.5.4.
Please let me know how I can make the result set scrollable.
Thanks in advance..
Netezza does not support scrollable cursors, the only type of cursor provided by the Netezza JDBC/ODBC/OLEDB drivers is the FORWARD_ONLY cursor. If you really need to be able to go back to prior rows you'll have to dump the result into a List object first and then you can scroll through it. Which is exactly the same thing that the JDBC driver or the database would have to do anyway. Scrollable cursors are extremely costly in terms of resources which is probably why Netezza does not support them.
Thank you Shawn.
I will dump the resultSet into a List.
Thanks.

