Getting users from database
Closed this issue · 1 comments
elenadobrescu21 commented
I am trying to get users from a database.
I have added the following code to the application.yml file,
hibernate:
# possible values: validate | update | create | create-drop
ddl-auto: create-drop
datasource:
url: jdbc:mysql://localhost:3306/user_management
username: root
password:
driver-class-name: com.mysql.jdbc.Driver`
I have a database with one user, but when I enter the credentials in postman I get the following exception "java.lang.StackOverflowError".
How should I modify the code to make it work?
igoralves98 commented
Here my working application.yml with MySQL database:
spring:
jackson:
serialization:
INDENT_OUTPUT: true
opa:
show-sql: true
properties:
hibernate:
dialect: org.hibernate.dialect.MySQL5Dialect
hibernate:
ddl-auto: update
naming-strategy: org.hibernate.cfg.ImprovedNamingStrategy
datasource:
url: jdbc:mysql://localhost/<your database name>
username: <your database username>
password: <your database password>
driver-class-name: com.mysql.jdbc.Driver
testWhileIdle: true
validationQuery: SELECT 1
Hope helps u.
Good luck.