Creating a local Database for a Java program

I want to make a Java program for compiling pedigrees, genealogy classes. And I need that when creating a new project, a database is created, in which the data would be entered and then used. I intend to implement the creation of a database based on SQL queries, but I do not know how. Or perhaps someone can advise a more convenient method for this case.

Author: spycrab193, 2020-05-30

2 answers

I may have misunderstood you :) but let's try. For local applications, you can use H2 or Sqlite, i.e. you are best off with something lightweight, embedded. If you are developing a server solution, then I would look in the direction of postgresql or MySQL.

When developing in Java, the ORM approach is usually used, look in the direction of Hibernate/JPA. When configuring hibernate, use the hibernate.hbm2ddl.auto property with the value create-drop then when starting your The application database schema will be deleted and re-created (convenient for development).

Also update/you can create a database schema and data using liquibase. It all depends on your needs

 0
Author: Alexesy Ivashin, 2020-05-30 20:20:23

If SQL, first install the database server on the local machine : MSSQL, Postgres, MySQL. Then practice creating a database, tables, and queries in SQL mode. Experience the information as it is stored, as data is added, as it is extracted. Then connect to the database in your programming language call commands, queries get data, send data .... And I think in the future you will be able to create your genealogy starting with Adam himself if of course you have data.

 0
Author: Aziz Umarov, 2020-05-30 19:02:12