Results 1 to 9 of 9
Like Tree1Likes
  • 1 Post By Tolls

Thread: Difference in the result returned by SQL DEVELOPER IDE and JDBC.

  1. #1
    Join Date
    Jul 2011
    Posts
    4
    Rep Power
    0

    Default Difference in the result returned by SQL DEVELOPER IDE and JDBC.

    I have a String query;
    when i execute this query using SQL DEVELOPER IDE i am getting 34 rows.
    But when execute the same query using Statement.executeQuery(query); i get 36 rows.
    The extra 2 rows returned are duplicate. I am unable to find the reason for this difference in the result returned by IDE and JDBC.

    The target DB is a oracle DB.

    Thanks in Advance

  2. #2
    JosAH's Avatar
    JosAH is offline Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    13,730
    Blog Entries
    7
    Rep Power
    21

    Default

    Maybe your SQL Developer IDE ate the last two rows? Who knows without seeing some relevant code ...

    kind regards,

    Jos
    cenosillicaphobia: the fear for an empty beer glass

  3. #3
    Tolls is online now Moderator
    Join Date
    Apr 2009
    Posts
    12,183
    Rep Power
    20

    Default

    Then either the queries aren't the same, the db isn't the same, or one or the other of your methods is counting incorrectly.
    There may be other options as well, but you really haven't given us much to go on.

  4. #4
    Join Date
    Jul 2011
    Posts
    4
    Rep Power
    0

    Default update

    i have checked and i am 100% sure that
    1) db is same
    2)user is same
    3) query string is same.
    4) java code counting is below

    int count=0;
    while(rs.next){
    count++;
    }

    one more thing that caught my attention is i have made both odbc6.jar and odbc14.jar available to my project. i dont know which class is loaded from which jar when i call Class.forName("oracle.jdbc.driver.OracleDriver");

    suspecting this issue could be due to odbc6.jar.

    debugging it....

  5. #5
    Tolls is online now Moderator
    Join Date
    Apr 2009
    Posts
    12,183
    Rep Power
    20

    Default

    Show us the queries then.
    Both the JDBC code and the query you run in SQL Developer.
    There is no way that you would be getting different results unless the data was different or the queries were different.

    You'll really be wasting your time trying to debug the drivers.

  6. #6
    Tolls is online now Moderator
    Join Date
    Apr 2009
    Posts
    12,183
    Rep Power
    20

    Default

    Oh yes, and it would be good manners to mention you have crossposted this at (at the least) OTN...both here and there.
    Especially since both I and jschell are saying essentially the same things.
    timberlake1865 likes this.

  7. #7
    Join Date
    Jul 2011
    Posts
    4
    Rep Power
    0

    Default

    Quote Originally Posted by timberlake1865 View Post
    i have checked and i am 100% sure that
    1) db is same
    2)user is same
    3) query string is same.
    4) java code counting is below

    int count=0;
    while(rs.next){
    count++;
    }

    one more thing that caught my attention is i have made both odbc6.jar and odbc14.jar available to my project. i dont know which class is loaded from which jar when i call Class.forName("oracle.jdbc.driver.OracleDriver");

    suspecting this issue could be due to odbc6.jar.

    debugging it....
    drivers are not the reason for this issue.


    this post is cross posted at OTN Discussion Forums : difference in the result returned by ...

  8. #8
    Join Date
    Jul 2011
    Posts
    4
    Rep Power
    0

    Default

    Quote Originally Posted by timberlake1865 View Post
    i have checked and i am 100% sure that
    1) db is same
    2)user is same
    3) query string is same.
    4) java code counting is below

    int count=0;
    while(rs.next){
    count++;
    }

    one more thing that caught my attention is i have made both odbc6.jar and odbc14.jar available to my project. i dont know which class is loaded from which jar when i call Class.forName("oracle.jdbc.driver.OracleDriver");

    suspecting this issue could be due to odbc6.jar.

    debugging it....
    drivers are not the reason for this issue.


    this post is cross posted at OTN Discussion Forums : difference in the result returned by ...

  9. #9
    Tolls is online now Moderator
    Join Date
    Apr 2009
    Posts
    12,183
    Rep Power
    20

    Default

    I know the drivers are not the issue.
    Until you post the query used on SQL Developer and the code used in Java all we can say is you are not doing the same thing, or looking at the same thing.

    If you persist in not providing this information then I'm simply going to give up on this thread.

Similar Threads

  1. Struts 2 error : No result defined for action / result
    By sameerk in forum Web Frameworks
    Replies: 1
    Last Post: 05-17-2011, 11:15 AM
  2. value returned is zero when it is not
    By gedas in forum New To Java
    Replies: 21
    Last Post: 03-27-2011, 08:23 PM
  3. get url returned by search
    By avizana in forum Networking
    Replies: 2
    Last Post: 03-14-2011, 08:43 PM
  4. Replies: 10
    Last Post: 12-22-2009, 12:09 PM
  5. Cant we have two values returned from a method in a class
    By jaiminparikh in forum Advanced Java
    Replies: 7
    Last Post: 03-21-2009, 04:20 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •