no scrolling cursors in oracle?

im trying to connect java to oracle8 (not 8i) using jdbc-odbc bridge (type 1 driver). 'previous' button on my GUI is supposed to display previous records and 'next' button moves to next records. the next button works fine...but on clicking previous buttons...i get exception that ResultSet is TYPE_FORWARD_ONLY.

then i read this in ODBC help docs:
[b]The Microsoft Cursor Library[/b] is a DLL that emulates scrollable cursor support. When loaded, it positions itself between the Microsoft Driver Manager and the Oracle ODBC driver.Therefore, all ODBC calls go through the cursor library, which in turn calls the Oracle ODBC driver. The Microsoft Cursor Library parses SQL syntax to support the WHERE CURRENT OF cursor clause. The Microsoft Cursor Library also modifies SQL statements before passing them to the Oracle ODBC driver. For example, FOR UPDATE and WHERE CURRENT OF cursor syntax cannot be seen by the Oracle ODBC driver.

The attribute SQL_ATTR_ODBC_CURSORS of the SQLSetConnectAttr call specifies how the Microsoft Driver Manager uses the Microsoft Cursor Library. A value of SQL_CUR_USE_IF_NEEDED directs the Microsoft Driver Manager to load the Microsoft Cursor Library if the Oracle ODBC driver does not support FETCH PRIOR, and a value of SQL_CUR_USE_ODBC always loads the Microsoft Cursor Library. A value of SQL_CUR_USE_DRIVER [b]requests the Oracle ODBC driver to use its internal scrolling capabilities (of which there are none)[/b].

i cant figure out a way out of this problem. if anyone knows a way out of this (how to make cursor scrollable)....plz help.

*curls up in a dark corner to cry*

ps. oh yeah! the same java code works fine wid access.
Class.forName ("sun.jdbc.odbc.JdbcOdbcDriver");
String url = "jdbc:odbc:abc";
Connection conn = DriverManager.getConnection (url, "scott", "tiger");
Statement stmet = conn.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.CONCUR_UPDATABLE);

ResultSet rst = stmet.executeQuery ("select ename from emp");
//check resultset type
if (rst.getType() == ResultSet.TYPE_SCROLL_INSENSITIVE)

if (rst.getType() == ResultSet.TYPE_FORWARD_ONLY)
[b]System.out.println("TYPE_FORWARD_ONLY"); [/b]
while (
System.out.println (rst.getString(1));[/code]

in the output i always get TYPE_FORWARD_ONLY
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!