aspose file tools*
The moose likes JDBC and the fly likes Database Issue when displaying data. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » JDBC
Bookmark "Database Issue when displaying data." Watch "Database Issue when displaying data." New topic
Author

Database Issue when displaying data.

Mayur Saparia
Greenhorn

Joined: Feb 13, 2013
Posts: 19


Output:

1 (user_id of first record)
12 (user_id of second record)
lalit
gm
lalit
admin
1
BUILD SUCCESSFUL (total time: 0 seconds)



Here my problem is that i have two records in database with primary key the user_id, as you can see the user_id of first record is getting printed and and then it prints rest of the second record.
I am clueless about it. It just prints the user_id of the first record and no other things of that records.

I am using Netbeans so please consider it while answering the question.
Please let me know what is the problem.

Thanks in advance.


Thanks In advance

Regards
Mayur.
amit punekar
Ranch Hand

Joined: May 14, 2004
Posts: 511
Hello,
What is the output of query looks like when you fire it in MYSQL itself?

regards,
amit
Mayur Saparia
Greenhorn

Joined: Feb 13, 2013
Posts: 19

No its the output from the java code.. I havent wrote anything before it so its just displaying the values of the database.
amit punekar
Ranch Hand

Joined: May 14, 2004
Posts: 511
Hello,
Did you check if you have "any" data for other columns apart from userid for the first record in the database. (userid = 1) ?
Can you confirm it by running query using MySQL UI and checking the output?

regards,
amit
Vinod Tiwari
Ranch Hand

Joined: Feb 06, 2008
Posts: 459
    
    1
Hi Mayur - I would advise you to check if other values in database are null or not. May be those values are null in database and you are trying to debug a non-issue.

BTW - your code looks fine.

Vinod
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Database Issue when displaying data.