This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes JDBC and the fly likes Funny issue with ResultSet Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "Funny issue with ResultSet" Watch "Funny issue with ResultSet" New topic
Author

Funny issue with ResultSet

Nk Don
Greenhorn

Joined: Jun 11, 2009
Posts: 3

I am facing typical issue with ResultSet.
I am using sybase 12.5 server and driver jconn3/jconn2 and java 1.6, I am giving simple query like select * from user and it is returning only the first two records and the remaining it is ignoring. Some of the tables I am not even getting single record even the table is having 20+ records.
The same code is working fine at my home computer and the only diff is I was using sybase dev version.
Is there problem with database configuration?
I appreciate for the help.
thanks and kind regards.
Jan Cumps
Bartender

Joined: Dec 20, 2006
Posts: 2491
    
    8

some things to check:

- are you sure that you connect to the right database,
- with the right user
- to the expected database schema.
The symptoms might tell that you are not seeing the tables that you are expecting.

Check if you get the same results if you query *the same* database withanother query tool, using *the same* user, schema and query.
Regards, Jan


OCUP UML fundamental and ITIL foundation
youtube channel
Nk Don
Greenhorn

Joined: Jun 11, 2009
Posts: 3
Thanks Jan,
I appreciate for the help.
I fugured it out that this could be a database configuration related issue. The same code is working fine with the other databses in the server and it is not working when I connect to the new database which we have created. I have created new table in my databse and imported the data from other data base( table structure is same) and not able to read from newly created table and it is working for the old table.
Unfortunately I was not able to reach my DBA....
thanks and kind regards,
Nanda




Jan Cumps wrote:some things to check:

- are you sure that you connect to the right database,
- with the right user
- to the expected database schema.
The symptoms might tell that you are not seeing the tables that you are expecting.

Check if you get the same results if you query *the same* database withanother query tool, using *the same* user, schema and query.
Regards, Jan
Nk Don
Greenhorn

Joined: Jun 11, 2009
Posts: 3
I got the resolution for this.

-I have created some tables and inserted the data in to these tables from database client.
-Try to read this configuration data from my java code and it did not return any data.
-Query executed in database client and able to seee the inserted records.

The actually issue is with the database client, in this particular client aucommit was disabled and the data inserted in to the tables were not committed. The database client was returning the data when I execute the select query with out commiting the data.

I have committed the data explicitely in my database client tool and now able to read the data from my Java code........

It is a silly mistake and also really big lesson for me...
Jan Cumps
Bartender

Joined: Dec 20, 2006
Posts: 2491
    
    8

Ah. Glad you found it.
And thank you for sharing your solution.

Regards, Jan
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Funny issue with ResultSet
 
Similar Threads
Problem with connection to remote access database
Restricting the rows fetched
getting empty resultset
time taken in rs.next()
Interview ques