Skip to main content

JavaFx 2.2.21 DataApp example questions

Please note these forums are being decommissioned and use the new and improved forums at
1 reply [Last post]
Joined: 2013-05-18

Downloaded JavaFx 2.2.21 examples

Java SE Development Kit 7 Downloads
JavaFX Demos and Samples Downloads
Windows 19.55 MB

Looking at DataApp because reading the Apress book 'Pro JavaFx 2.0' says 'JavaFX 2.0 introduces the JavaFX Beans specification that adds properties support to Java objects through the help of the properties classes from the JavaFX 2.0 properties and bindings framework...with two Properties Strategies: Eagerly Instantiated, Lazily Instantiated.'

I'm new to JavaFX 2.0 (and Java) and have heard IDEs like NetBeans have wizards for bindings, properties, annotation type things? Are there wizards for the new JavaFx 2.0 Beans? Probably not. No JavaFx Beans Wizards that I can see.

Maybe Oracle/ could use some more JavaFx 2.0 Beans examples?

Anyway, Have trouble right away following the DataApp README

1. Install the MySQL drivers into GlassFish. Manually copy the mysql-connector-java-5.1.13-bin.jar file from the netbeans-install-dir\ide\modules\ext\ to the glassfish-install-dir/glassfish/lib directory, where netbeans-install-dir and glassfish-install-dir are the directories into which the products were installed. For example, on Windows the install directory for products is typically in the C:\Program Files\ or C:\Program Files (x86)\ directories.

$ find '/c/Program Files/NetBeans 7.3/java/modules' -iname 'mysql*jar'

Found MySQL jar MySQL website
[MySQL 5.6-latest] Download Connector/J

Where do I place this file in NetBeans?

Anyway, placed mysql jar in Glassfish lib (but not in NetBeans)

Using MySQL jar is next immediate problem

From glassfish asadmin> I try:

create-jdbc-connection-pool --datasourceclassname=com.mysql.jdbc.jdbc2.optional.MysqlDataSource --restype=com.mysql.jdbc.javax.sql.ConnectionPoolDataSource --property=portNumber=3306:password=mypassword:user=root:serverName=\;profileSQL\\=true MySQL-Pool

Error from GlassFish indicates acceptable values:

All of my available reference documentation is different from above choices:
From MMySQL 5.6 documents
The name of the class that implements java.sql.Driver in MySQL Connector/J is com.mysql.jdbc.Driver.
From GlassFish documents
From MySQL documents

I try several permutations and end of with

create-jdbc-connection-pool --datasourceclassname=com.mysql.jdbc.Driver --restype=javax.sql.ConnectionPoolDataSource --property=portNumber=3306:password=mypassword:user=root:serverName=\;profileSQL\\=true MySQL-Pool

So, what the heck, I try javax.sql.ConnectionPoolDataSource (after all it is an 'acceptable' value)

create-jdbc-resource --connectionpoolid MySQL-Pool javax/DataFx

I wonder if 'javax/DataFx' has significant parts like 'javax' part?

asadmin> list-jdbc-resources
Command list-jdbc-resources executed successfully.

start-database --dbuser=root --dbpassword=mypassword

asadmin> start-database --dbhost= --dbport=3306
Starting database in Network Server mode on host and port 3306.
Unable to start database. Please check log in C:\Users\Brad\Software\Glassfish3\glassfish\databases\derby.log.
Command start-database failed.

No joy of course--think I just learned default is derby (?)

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
Joined: 2013-05-18

After further reading the start-database command was unnecessary. The command is indeed used for local derby databases, not MySQL.

Used these commands:

create-jdbc-connection-pool --datasourceclassname=com.mysql.jdbc.jdbc2.optional.MysqlConnectionPoolDataSource --restype=javax.sql.ConnectionPoolDataSource --property=portNumber=3306:password=mypassword:user=root:serverName=\\=true MySQL-Pool

create-jdbc-resource --connectionpoolid MySQL-Pool jdbc/MySQL

And am currently exploring Glassfish Admin Panel at http://localhost:4848