File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes JavaFX and the fly likes How to populate a TableView with data fetched from database Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Java » JavaFX
Bookmark "How to populate a TableView with data fetched from database" Watch "How to populate a TableView with data fetched from database" New topic
Author

How to populate a TableView with data fetched from database

Oliver Much
Greenhorn

Joined: Aug 06, 2013
Posts: 1
I have a TableView that was created in JavaFx SceneBuilder. Does anyone know how to go about populating it with data from a database? I've looked around but the sample code I get are only come in fragments which I can't really get my head around. I'm a newbie at programming in JavaFx and was hoping to find some sample code that does this at some basic beginner's level, for study.

Would really appreciate some help here. Thank you all in advance.
Ranganathan Kaliyur Mannar
Bartender

Joined: Oct 16, 2003
Posts: 1075
    
  10

Hi Oliver,
Welcome to the Ranch!

I would like to point you to the tutorial page which explains working with TableView. Once you get going with this, you should be able to fetch data from the database and populate the table.


Ranga.
SCJP 1.4, OCMJEA/SCEA 5.0.
John Damien Smith
Ranch Hand

Joined: Jan 26, 2012
Posts: 100
    
    7
Review this sample code for populating a ListView from a H2 database.

Try to get it running.

Once you have it running and understand it, try to adapt it to use a TableView (based on information provided in the tutorial Ranganathan linked).

If you are a newbie to JavaFX, try something different from accessing a database via a TableView - e.g. just use the JavaFX library without database integration and learn how to use the scene graph by creating something like a really drawing app.
 
Consider Paul's rocket mass heater.
 
subject: How to populate a TableView with data fetched from database
 
Similar Threads
Talk about: JavaFX: Developing Rich Internet Applications
JTable in JavaFX
Displaying data from Javafx Table
How to populate TableView data on the other screen TextField
can't run app outside Netbeans - (javafx - ejb - glassfish)