Search code examples
javadatabasejavafxrealm

Database for Javafx without SQL


it´s possible to use a database in JavaFX without write SQL Code?

Obs: A example for Android is Realm.io.


Solution

  • The best way to do it is with:

    JPA + Hibernate and H2 Database.

    1. Setup JPA with modeler, so its easy to create models with annotation/Serializable. (http://jpamodeler.github.io/)

    Tutorial: https://www.youtube.com/watch?v=g8B764qNkc0

    1. Setup Hibernate (http://hibernate.org/)
    2. Setup H2 Database (http://www.h2database.com/html/main.html)
    3. Setup Persistence.xml
    4. Create model classes
    5. Create EntityManager

    Tutorial to get it up and running: https://www.youtube.com/watch?v=CfGDZmPj3Qw

    The result is very similiar to Realm.io in Android.