JDBC and surprise with scrolling

C

chris

Hi,

My users table in an Oracle 8.1.7 DB contains record "abcdefgijk"
and when I use the code as follows I get the expected result
......
con = DriverManager.getConnection(url, "chris", "pass");
Statement select = con.createStatement();
sqlQuery = "select id, data from users where id=1";
........

but when I use the code such like the one below I get the result as hex
string 0x6162636465666768696A6B that I don't want
......
con = DriverManager.getConnection(url, "chris", "pass");
Statement select = con.createStatement(
ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.CONCUR_UPDATABLE);
sqlQuery = "select id, data from users where id=1";
........

I looked for the solution everywhere but i failed.
Could anyone of you explain it to me what has happened here?

Thanks in advance.

Chris
 
J

John C. Bollinger

chris said:
Hi,

My users table in an Oracle 8.1.7 DB contains record "abcdefgijk"
and when I use the code as follows I get the expected result
......
con = DriverManager.getConnection(url, "chris", "pass");
Statement select = con.createStatement();
sqlQuery = "select id, data from users where id=1";
........

but when I use the code such like the one below I get the result as hex
string 0x6162636465666768696A6B that I don't want
......
con = DriverManager.getConnection(url, "chris", "pass");
Statement select = con.createStatement(
ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.CONCUR_UPDATABLE);
sqlQuery = "select id, data from users where id=1";
........

I looked for the solution everywhere but i failed.
Could anyone of you explain it to me what has happened here?

Perhaps someone can, but you have left out the important parts that most
people would use to get a clue. I.e. where is the code with which you
extract the results you described? What JDBC driver are you using? Are
you using the same DB URL in both cases?

Can you show us a complete test code that exhibits both of the behaviors
in one run? It is possible that the problem arises because of your
request for a non-default statement, but it's also possible (and perhaps
more likely) that the problem is elsewhere. You have shown us only the
parts of the code that you think are responsible for the behavior.


John Bollinger
(e-mail address removed)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,537
Members
45,021
Latest member
AkilahJaim

Latest Threads

Top