Skip to content

Latest commit

 

History

History
35 lines (23 loc) · 2.7 KB

readme.md

File metadata and controls

35 lines (23 loc) · 2.7 KB

Hibernate CURD terminal application

Using this code, you'll be able to use JDBC and Hibernate to integrates a PC Bang chain database.

Get started

  1. Pull the code
  2. Open with in IntelliJ
  3. Adjust the secrets
    • Go to src/main/java/src/GlobalVariables and adjust it

      public static int port = **YOUR PORT**;
      public static String host = **YOUR HOST**;
      public static String db_name = **YOUR DATABASE NAME**;
      public static String username = **YOUR USERNAME**;
      public static String password = **YOUR PASSWORD**;

    • Go to src/main/java/ressources/hibernate.cfg.xml and adjust it
      <property name="connection.url">**YOUR URL**</property>
      <property name="hibernate.connection.username">**YOUR USERNAME**</property>
      <property name="hibernate.connection.password">**YOUR PASSWORD**</property>

  4. Run the code all is done ---

Note

Please note that adding and update feature in the terminal application is only write for customer instance. For adding, and remouving action to work in my-sql please set foreign key check to false :

SET GLOBAL FOREIGN_KEY_CHECKS=0;

Database schema

enter image description here