aspose file tools*
The moose likes JDBC and the fly likes TYPE_SCROLL_INSENSITIVE corrupts the result set data Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » JDBC
Bookmark "TYPE_SCROLL_INSENSITIVE corrupts the result set data" Watch "TYPE_SCROLL_INSENSITIVE corrupts the result set data" New topic
Author

TYPE_SCROLL_INSENSITIVE corrupts the result set data

Manju Krishna
Ranch Hand

Joined: Apr 09, 2009
Posts: 48
    
    1
Hi,

When i execute a query without any parameters in createStatement like,

stmt = con.createStatement();

and execute the query, the resul gets printed out correctly..

but if I set it like,

stmt = con.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE,ResultSet.CONCUR_READ_ONLY);

and execute.. it prints out "???" when Resultset is iterated..

Can anyone help on this?
Thanks in adavance
Peter Johnson
author
Bartender

Joined: May 14, 2008
Posts: 5830
    
    7

Are you sure that your database supports TYPE_SCROLL_INSENSITIVE? Not all of them do.

What database are you using?


JBoss In Action
Manju Krishna
Ranch Hand

Joined: Apr 09, 2009
Posts: 48
    
    1
I m using Oracle 9i..

I found that the query was working fine in our local DB.. but failing in remote DB..
Also found the character set definition to be different in local and remote..

One strange behaviour was... in Remote DB.. If i used a createStatement without the result set type and concurency.. like
stmt = con.createStatement; then the result set returned correct data.. It returns "???" only if i use TYPE_SCROLL_INSENSITIVE and CONCUR_READ_ONLY... Why is this so ??

Moreover.. the local DB was able to return correcly for the same data.. whatever may be the createStatement parameters...
 
jQuery in Action, 2nd edition
 
subject: TYPE_SCROLL_INSENSITIVE corrupts the result set data