954,506 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

database contents display in a gui

i need to display the contents of a database(table) MS access db, on to the screen. how do i got abt it??? the data keeps changing dynamically...the program should be able to refresh it self

abdulraqeeb33
Light Poster
41 posts since Jan 2008
Reputation Points: 17
Solved Threads: 0
 

Create a JTable, create a custom TableModel for it, and have a Timer or whatever refresh that at regular intervals.

jwenting
duckman
Team Colleague
8,392 posts since Nov 2004
Reputation Points: 1,662
Solved Threads: 337
 

Tablemodel??? wat is that? do u have or know of any simple example that explains it?

Create a JTable, create a custom TableModel for it, and have a Timer or whatever refresh that at regular intervals.
abdulraqeeb33
Light Poster
41 posts since Jan 2008
Reputation Points: 17
Solved Threads: 0
 

Try to cut up your structure of your program in several little pieces and start with those one by one.

For example: You'll first need to make a connection to a database itself.
If your connection works, you can try to read out your data. (A datareader is recommended).
After this you can start building up your gui (there is quite a lot of documentation on this too, try the java swing components) and how you are going to refresh the data.

Baby steps, baby steps :p.

The making of a connection, reading it and the creation of the gui are well documented on the internet. I suggest that you try to make those step by step. If you have difficulties at any given moment with any given 'module', you can always ask for a specific problem.

I hope this helps a bit, good luck with your program.

Jens
Light Poster
49 posts since Apr 2008
Reputation Points: 13
Solved Threads: 6
 

thanks for the steps... but i know upto retrieving values from the db...how do i display it in a table? and with the varying number of records in how does the table rows increase or decrease?

Try to cut up your structure of your program in several little pieces and start with those one by one.

For example: You'll first need to make a connection to a database itself. If your connection works, you can try to read out your data. (A datareader is recommended). After this you can start building up your gui (there is quite a lot of documentation on this too, try the java swing components) and how you are going to refresh the data.

Baby steps, baby steps :p.

The making of a connection, reading it and the creation of the gui are well documented on the internet. I suggest that you try to make those step by step. If you have difficulties at any given moment with any given 'module', you can always ask for a specific problem.

I hope this helps a bit, good luck with your program.

abdulraqeeb33
Light Poster
41 posts since Jan 2008
Reputation Points: 17
Solved Threads: 0
 

Start with a simple tutorial on JTable: http://java.sun.com/docs/books/tutorial/uiswing/components/table.html

(These examples that you keep asking for are incredibly easy to locate with a very simple search. You should take a little initiative to find them before asking others to give them to you.)

Ezzaral
Posting Genius
Moderator
15,986 posts since May 2007
Reputation Points: 3,250
Solved Threads: 847
 

This question has already been solved

Post: Markdown Syntax: Formatting Help
You