| Author |
JDBC connection with JTable
|
MIRANGA_H
Greenhorn
Joined: Jan 27, 2005
Posts: 13
|
|
Hi, i have a oracle table with 3 columns. i want to populate a JTable by retrieving data from the oracle table. it should populate dynamicaly
|
 |
Michael Duffy
Ranch Hand
Joined: Oct 15, 2005
Posts: 163
|
|
Originally posted by Miranga: Hi, i have a oracle table with 3 columns. i want to populate a JTable by retrieving data from the oracle table. it should populate dynamicaly
Start by writing a single object that does nothing but connect to Oracle and return the data in an object or data structure. (No Swing or JTable needed.) Once you have that working perfectly you can write you Swing UI and have it call your persistence object's methods and display the data that comes back. Decomposition is always the best way to attack a complex problem. Make the smaller parts work correctly and then knit them together to solve the original problem.
|
%
|
 |
Bear Bibeault
Author and ninkuma
Marshal
Joined: Jan 10, 2002
Posts: 56153
|
|
"Miranga", You have been warned on two previous occasions to change your display name to conform with Ranch policies. Consider this your third and final warning. Take a look at the JavaRanch Naming Policy and adjust your display name to match it prior to your next post. In particular, your display name must be a first and a last name separated by a space character, and must not be obviously fictitious. Accounts with invalid display names are removed. bear Forum Bartender [ December 04, 2005: Message edited by: Bear Bibeault ]
|
[Smart Questions] [JSP FAQ] [Books by Bear] [Bear's FrontMan] [About Bear]
|
 |
sinasi susam
Ranch Hand
Joined: Jul 15, 2005
Posts: 67
|
|
You can use AbstractTableModel to retrieve datas from db table.But you have to extend it in order to use. First you load datas from table to model and later you gave it to jtable in its constructur. @Bear is not your name i think,right?
|
 |
Bear Bibeault
Author and ninkuma
Marshal
Joined: Jan 10, 2002
Posts: 56153
|
|
Originally posted by sinasi susam: @Bear is not your name i think,right?
Discussion about the naming convention should take place in the JavaRanch forum. My own display name was validated almost 9000 posts ago and is really none of your concern. "Miranga" will need to change his or her display name or the account will be closed.
|
 |
 |
|
|
subject: JDBC connection with JTable
|
|
|