change the database from hsqldb to mysql and the mysql is hosted by

aliyun.
This commit is contained in:
yuyang 2015-04-08 10:32:39 +08:00
parent 2048ee7531
commit 965ef801de
2 changed files with 22 additions and 16 deletions

View file

@ -210,13 +210,19 @@
</dependency>
<!-- Databases - Uses HSQL by default -->
<!-- <dependency> <groupId>mysql</groupId> <artifactId>mysql-connector-java</artifactId> <version>${mysql.version}</version> </dependency> -->
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>${mysql.version}</version>
</dependency>
<!--
<dependency>
<groupId>org.hsqldb</groupId>
<artifactId>hsqldb</artifactId>
<version>${hsqldb.version}</version>
<scope>runtime</scope>
</dependency>
-->
<!-- For MySql only -->
<!-- <dependency> <groupId>mysql</groupId> <artifactId>mysql-connector-java</artifactId> <version>${mysql.version}</version> </dependency> -->

View file

@ -7,35 +7,35 @@
#-------------------------------------------------------------------------------
# HSQL Settings
jdbc.driverClassName=org.hsqldb.jdbcDriver
jdbc.url=jdbc:hsqldb:mem:petclinic
jdbc.username=sa
jdbc.password=
#jdbc.driverClassName=org.hsqldb.jdbcDriver
#jdbc.url=jdbc:hsqldb:mem:petclinic
#jdbc.username=sa
#jdbc.password=
# Properties that control the population of schema and data for a new data source
jdbc.initLocation=classpath:db/hsqldb/initDB.sql
jdbc.dataLocation=classpath:db/hsqldb/populateDB.sql
#jdbc.initLocation=classpath:db/hsqldb/initDB.sql
#jdbc.dataLocation=classpath:db/hsqldb/populateDB.sql
# Property that determines which database to use with an AbstractJpaVendorAdapter
jpa.database=HSQL
#jpa.database=HSQL
jpa.showSql=true
#-------------------------------------------------------------------------------
# MySQL Settings
#jdbc.driverClassName=com.mysql.jdbc.Driver
#jdbc.url=jdbc:mysql://localhost:3306/petclinic
#jdbc.username=root
#jdbc.password=
jdbc.driverClassName=com.mysql.jdbc.Driver
jdbc.url=jdbc:mysql://115.29.227.156:3306/petclinic
jdbc.username=root
jdbc.password=Yang
# Properties that control the population of schema and data for a new data source
#jdbc.initLocation=classpath:db/mysql/initDB.sql
#jdbc.dataLocation=classpath:db/mysql/populateDB.sql
jdbc.initLocation=classpath:db/mysql/initDB.sql
jdbc.dataLocation=classpath:db/mysql/populateDB.sql
# Property that determines which Hibernate dialect to use
# (only applied with "applicationContext-hibernate.xml")
#hibernate.dialect=org.hibernate.dialect.MySQLDialect
hibernate.dialect=org.hibernate.dialect.MySQLDialect
# Property that determines which database to use with an AbstractJpaVendorAdapter
#jpa.database=MYSQL
jpa.database=MYSQL