idea2019搭建ssm(spring+springMVC+mybatis)项目

本文详细介绍了如何使用IDEA2019创建一个SSM项目,包括新建项目、目录结构设置、相关依赖引入、实体、DAO接口定义、Mapper配置、Spring XML配置以及日志和Web配置。
摘要由CSDN通过智能技术生成

1.新建项目
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
2.在项目根目录新建Directry:target
在这里插入图片描述
3.建好项目目录:
在这里插入图片描述

4.引入相关依赖
5.定义实体domain
6.定义对应dao接口
7.配置mapper.xml文件
8.新建三个spring-xx.xml文件
在这里插入图片描述
spring-dao.xml:(spring-mybatis整合配置文件)

<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
       xmlns:context="http://www.springframework.org/schema/context"
       xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
       http://www.springframework.org/schema/beans/spring-beans.xsd
       http://www.springframework.org/schema/contex
       http://www.springframework.org/schema/context/spring-context.xsd">

    <!-- 配置整合mybatis过程 -->
    <!-- 1.配置数据库相关参数properties的属性:${url} -->
    <context:property-placeholder location="classpath:jdbc.properties"/>

    <!-- 2.数据库连接池 -->
    <bean id="dataSource" class="com.mchange.v2.c3p0.ComboPooledDataSource">
        <!-- 配置连接池属性 -->
        <property name="driverClass" value="${jdbc.driver}"/>
        <property name="jdbcUrl" value="${jdbc.url}"/>
        <property name="user&#
  • 14
    点赞
  • 77
    收藏
    觉得还不错? 一键收藏
  • 2
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值