mirror of
https://github.com/spring-projects/spring-petclinic.git
synced 2025-07-17 21:15:50 +00:00
mysql対応 & shell script 追加
This commit is contained in:
parent
90ef404d3d
commit
fd1074da98
2 changed files with 42 additions and 16 deletions
26
Scripts/spring_petclinic_jdbc_conf.sh
Normal file
26
Scripts/spring_petclinic_jdbc_conf.sh
Normal file
|
@ -0,0 +1,26 @@
|
|||
#!/bin/sh
|
||||
|
||||
# PetClinic appliaction deployment script
|
||||
TMPDIR=/tmp/arm-workdir
|
||||
PROPFILE=$TMPDIR/petclinic/WEB-INF/classes/spring/data-access.properties
|
||||
|
||||
mkdir -p $TMPDIR/petclinic
|
||||
unzip /tmp/petclinic.war -d $TMPDIR/petclinic
|
||||
|
||||
|
||||
sed -e "s/\${HOSTNAME}/$1/g" \
|
||||
-e "s/\${SERNAME}/$2/g" \
|
||||
-e "s/\${PASSWORD}/$3/g" $PROPFILE > /tmp/jdbc.tmp$$
|
||||
|
||||
|
||||
cp -f /tmp/jdbc.tmp$$ $PROPFILE
|
||||
rm -f /tmp/jdbc.tmp$$
|
||||
|
||||
cd /tmp/arm-workdir/petclinic
|
||||
zip -r /tmp/arm-workdir/petclinic-updated.zip ./*
|
||||
mv /tmp/arm-workdir/petclinic-updated.zip /tmp/arm-workdir/petclinic.war
|
||||
sudo mv /tmp/arm-workdir/petclinic.war $4/webapps
|
||||
|
||||
#sudo sh /opt/tomcat7/bin/shutdown.sh
|
||||
#sudo sh /opt/tomcat7/bin/startup.sh
|
||||
exit 0
|
|
@ -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
|
||||
#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://${HOSTNAME}:3306/petclinic
|
||||
jdbc.username=${USERNAME}
|
||||
jdbc.password=${PASSWORD}
|
||||
|
||||
# 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
|
||||
|
|
Loading…
Reference in a new issue