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
|
|
0
|
|
|
|
Reply
|
krzysiek1
|
8/19/2003 4:13:29 PM |
|
chris wrote:
> 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
jobollin@indiana.edu
|
|
0
|
|
|
|
Reply
|
jobollin (1553)
|
8/19/2003 5:27:41 PM
|
|