• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to Display data from database

 
Ahesanali Khanusiya
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I want to fetch all record from database and display in Swing component Jtable can you tell me how it will done??? Please explain with example.........
 
Maneesh Godbole
Saloon Keeper
Posts: 11021
12
Android Eclipse IDE Google Web Toolkit Java Mac Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In pseudo code
1) Pull out all required data from the DB
2) Iterate over the ResultSet and insert each record into the appropriate table model
3) Pass the model to the table
4) Display the model.

Out of these steps where are you stuck?
More about models and tables here http://download.oracle.com/docs/cd/E17409_01/javase/tutorial/uiswing/components/table.html
 
Darryl Burke
Bartender
Posts: 5125
11
Java Netbeans IDE Opera
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hm,aren't you supposed to DoYourOwnHomework?
 
Michael Dunn
Ranch Hand
Posts: 4632
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
> Please explain with example.........

there's already about 4,000,000 examples on google, why add another.

if you do not know how to do something, research is your first step (not last)

google keywords
JTable JDBC
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic