zoukankan      html  css  js  c++  java
  • Spring PecClinic宠物医院---安装

    1、下载源代码

    如果本地安装了Git工具,可以直接使用命令

    git clone https://github.com/spring-projects/spring-petclinic.git

    如果没有Git工具,需要到https://github.com/spring-projects/spring-petclinic下载源码包

    2、将petclinic工程导入Eclipse

    3、petclinic默认使用HsqlDB,我本地只有Mysql数据库,因此需要配置数据库链接信息,具体有以下两个地方

    (1)修改pom.xml,去掉对Mysql的依赖项目的注释

    <dependency>
    <groupId>mysql</groupId>
    <artifactId>mysql-connector-java</artifactId>
    <version>${mysql.version}</version>
    </dependency>

    (2)修改data-access.properties

    jdbc.driverClassName=com.mysql.jdbc.Driver
    jdbc.url=jdbc:mysql://localhost:3306/happycardata?useUnicode=true&characterEncoding=UTF-8&zeroDateTimeBehavior=convertToNull
    jdbc.username=root
    jdbc.password=123456

    # 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

    # Property that determines which Hibernate dialect to use
    # (only applied with "applicationContext-hibernate.xml")
    hibernate.dialect=org.hibernate.dialect.MySQLDialect

    # Property that determines which database to use with an AbstractJpaVendorAdapter
    jpa.database=MYSQL
    jpa.showSql=true

    3、对整个工程进行Maven install,确保install执行成功

    4、启动tomcat,访问http://localhost:8080/petclinic/

    这时候应该可以看到两只活泼可爱的小狗狗了


    宠物医院业务上设计比较简单,主要有三个角色:宠物pets、医生veterinarians、主人owner。

    主要的关系有两个:

    (1)一个主人可以拥有多个宠物

    (2)一个主人可以多次问诊记录

  • 相关阅读:
    mongodb副本集群搭建
    redis 哨兵集群搭建
    mysql binlog备份
    MySQL 日志
    mysql 事务及innodb隔离级别
    sysbench使用
    PXC安装
    mysql搭建主从数据库
    GTID
    文件的压缩和解压
  • 原文地址:https://www.cnblogs.com/mingziday/p/4697162.html
Copyright © 2011-2022 走看看