Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Funny issue with ResultSet

 
Nk Don
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

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
Posts: 2584
11
C++ Linux Netbeans IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 2584
11
C++ Linux Netbeans IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ah. Glad you found it.
And thank you for sharing your solution.

Regards, Jan
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic