JavaFX - Database + Table
By Rakesh Menon on Dec 23, 2009
JavaFX + Apache Derby Database + JDBC - I have seen several queries related to this, hence thought of providing a sample application. In order to avoid any back-end database setup, I'm using Embedded Derby which will create database in <UserHome>/JavaFXDatabase/. The Derby jars are hosted as separate JNLP extension - ApacheDerby.jnlp - which is referenced in application jnlp files.
Click "Populate" button to add some dummy data to the Table.
<script src="http://dl.javafx.com/1.2/dtfx.js"></script> <script src="/rakeshmenonp/resource/JavaFXDatabase/JavaFXDatabase.js"></script>
Note: Application may take a little longer to download due to large size of Derby jar files. Application will show two certificate dialogs - One for application and another for Derby Extension. These permissions are required so as to create database in user's home directory.
Database access code is same as any other java application - DBUtils.java. The table is implemented using Rectangle, Label and Panel Layout. Its not really scalable as its not using any virtual concepts, all nodes are real. The approach can be used for simple applications. Please refer to CustomerTable.fx for more information.
Try it out and let me know feedback..
..and that brings the end of this year's blogs. It was nice sharing all the information with you.. "See" you next year!
Merry Christmas and Happy New Year to All.. Have Fun!