This week's book giveaway is in the Cloud forum.
We're giving away four copies of Terraform in Action and have Scott Winkler on-line!
See this thread for details.
Win a copy of Terraform in Action this week in the Cloud forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • Rob Spoor
  • Bear Bibeault
Saloon Keepers:
  • Jesse Silverman
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • Al Hobbs
  • salvin francis

JDBC connection with JTable

 
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Ranch Hand
Posts: 163
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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.
 
Sheriff
Posts: 67601
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
"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 ]
 
Ranch Hand
Posts: 67
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Sheriff
Posts: 67601
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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.
reply
    Bookmark Topic Watch Topic
  • New Topic