I have query here, i am trying to connect the above code with mysql. I tried having MAVEN dependency of MYSQL along with related changes in application.properties file but no success. Could you please help me on this.
The only change being to the pom is adding mysql dependency. <dependency> <groupId>mysql</groupId> <artifactId>mysql-connector-java</artifactId> </dependency>
application.properties file
# =============================== # = DATA SOURCE # ===============================
# Set here configurations for the database connection
# Connection url for the database spring.datasource.url = jdbc:mysql://localhost:3306/activiti?useSSL=false
# Username and password spring.datasource.username = root spring.datasource.password = root
# Keep the connection alive if idle for a long time (needed in production) spring.datasource.testWhileIdle = true spring.datasource.validationQuery = SELECT 1
# Use spring.jpa.properties.* for Hibernate native properties (the prefix is # stripped before adding them to the entity manager).
# Show or not log for each sql query spring.jpa.show-sql = true
# Hibernate ddl auto (create, create-drop, update): with "update" the database # schema will be automatically updated accordingly to java entities found in # the project spring.jpa.hibernate.ddl-auto = create-drop
When i tried above configuration i got exception stating "Could not update Activiti database schema: unknown version from database: '5.21.0.0'". If there is a mismatch in configuration would like to know what are the correct version numbers.
I changed activiti version to 5.21.0 in application properties file. After running i greeted with below Exception Caused by: com.mysql.jdbc.exceptions.jdbc4.MySQLIntegrityConstraintViolationException: Duplicate entry 'user' for key 'PRIMARY'