spring 中mysql和jpa的配置:
src/main/resources中的application.properties中写:
#DB properties:
spring.datasource.url=jdbc:mysql://localhost:3306/student?useUnicode=true&characterEncoding=utf-8&useSSL=false
spring.datasource.username=root
spring.datasource.password=1234
spring.datasource.driverClassName=com.mysql.jdbc.Driver
#JPA Configuration:
spring.jpa.show-sql=true
spring.jpa.generate-ddl=true
spring.jpa.hibernate.ddl-auto=update
spring.jpa.database-platform=org.hibernate.dialect.MySQL5Dialect
#spring.jpa.hibernate.naming_strategy=org.hibernate.cfg.ImprovedNamingStrategy
#spring.jpa.database=org.hibernate.dialect.MySQL5InnoDBDialect
#view Configuration:
#spring.view.prefix=/WEB-INF/views/
#Server Configuration:
server.port=80
相当于将spring和hibernate的配置整合
写完保存后maven install就行