当用mvn integration-test时jdbc.properties文件 配置如下:
### Enable this section when use Maven to run integration tests and runs ###
jdbc.driverClassName=com.mysql.jdbc.Driver
jdbc.url=jdbc:mysql://localhost/myproject?createDatabaseIfNotExist=true&useUnicode=true&characterEncoding=utf-8
jdbc.username=root
jdbc.password=
hibernate.dialect=org.hibernate.dialect.MySQLInnoDBDialect
# Needed by Hibernate3 Maven Plugin defined in pom.xml
hibernate.connection.username=root
hibernate.connection.password=
hibernate.connection.url=jdbc:mysql://localhost/myproject?createDatabaseIfNotExist=true&useUnicode=true&characterEncoding=utf-8
hibernate.connection.driver_class=com.mysql.jdbc.Driver
当用tomcat运行时就要配置jdbc.properties如下所示:
##################### For deployment and WTP uses #####################
jdbc.driverClassName=com.mysql.jdbc.Driver
jdbc.url=jdbc:mysql://localhost/radicalibrary?createDatabaseIfNotExist=true&useUnicode=true&characterEncoding=utf-8
jdbc.username=root
jdbc.password=
hibernate.dialect=org.hibernate.dialect.MySQLInnoDBDialect
hibernate.hbm2ddl=update
这是因为maven运行时会到pom.xml文件里面去找Database settings的配置,再去配置jdbc.properties里面的属性值,如果我们遭再去配置的话,就会有冲突了,so....