Results 1 to 9 of 9
- 07-24-2011, 09:11 AM #1
Member
- Join Date
- Jul 2011
- Posts
- 4
- Rep Power
- 0
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
- 07-24-2011, 09:46 AM #2
- Join Date
- Sep 2008
- Location
- Voorschoten, the Netherlands
- Posts
- 11,402
- Blog Entries
- 7
- Rep Power
- 17
Maybe your SQL Developer IDE ate the last two rows? Who knows without seeing some relevant code ...
kind regards,
JosWhen people rob a bank they get a penalty; when banks rob people they get a bonus.
- 07-25-2011, 10:22 AM #3
Moderator
- Join Date
- Apr 2009
- Posts
- 10,461
- Rep Power
- 16
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.
- 07-26-2011, 10:08 AM #4
Member
- Join Date
- Jul 2011
- Posts
- 4
- Rep Power
- 0
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....
- 07-26-2011, 10:11 AM #5
Moderator
- Join Date
- Apr 2009
- Posts
- 10,461
- Rep Power
- 16
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.
- 07-26-2011, 10:12 AM #6
Moderator
- Join Date
- Apr 2009
- Posts
- 10,461
- Rep Power
- 16
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.
- 07-27-2011, 07:31 AM #7
Member
- Join Date
- Jul 2011
- Posts
- 4
- Rep Power
- 0
drivers are not the reason for this issue.
this post is cross posted at OTN Discussion Forums : difference in the result returned by ...
- 07-27-2011, 07:31 AM #8
Member
- Join Date
- Jul 2011
- Posts
- 4
- Rep Power
- 0
drivers are not the reason for this issue.
this post is cross posted at OTN Discussion Forums : difference in the result returned by ...
- 07-27-2011, 09:25 AM #9
Moderator
- Join Date
- Apr 2009
- Posts
- 10,461
- Rep Power
- 16
Similar Threads
-
Struts 2 error : No result defined for action / result
By sameerk in forum Web FrameworksReplies: 1Last Post: 05-17-2011, 10:15 AM -
value returned is zero when it is not
By gedas in forum New To JavaReplies: 21Last Post: 03-27-2011, 07:23 PM -
get url returned by search
By avizana in forum NetworkingReplies: 2Last Post: 03-14-2011, 07:43 PM -
Difference between JDBC Statement and PreparedStatement
By anandjain1984 in forum JDBCReplies: 10Last Post: 12-22-2009, 11:09 AM -
Cant we have two values returned from a method in a class
By jaiminparikh in forum Advanced JavaReplies: 7Last Post: 03-21-2009, 03:20 AM


1Likes
LinkBack URL
About LinkBacks
Reply With Quote

Bookmarks