JDBC and surprise with scrolling

Discussion in 'Java' started by chris, Aug 19, 2003.

  1. chris

    chris Guest

    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
    chris, Aug 19, 2003
    #1
    1. Advertising

  2. 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
    John C. Bollinger, Aug 19, 2003
    #2
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Keith Wansbrough

    Re: jdbc help:sun.jdbc.odbc.JdbcOdbcDriver

    Keith Wansbrough, Aug 16, 2004, in forum: Java
    Replies:
    0
    Views:
    736
    Keith Wansbrough
    Aug 16, 2004
  2. Betty
    Replies:
    1
    Views:
    9,851
    Juha Laiho
    May 21, 2005
  3. Jesus M. Salvo Jr.
    Replies:
    2
    Views:
    4,043
    robert
    Feb 11, 2006
  4. Bruce
    Replies:
    4
    Views:
    740
    Bjorn Abelli
    Mar 25, 2006
  5. Lew
    Replies:
    0
    Views:
    503
Loading...

Share This Page