Using this code, you'll be able to use JDBC and Hibernate to integrates a PC Bang chain database.
- Pull the code
- Open with in IntelliJ
- 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>
-
- Run the code all is done ---
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;