| <?xml version="1.0" encoding="UTF-8" ?> |
| <!DOCTYPE configuration |
| PUBLIC "-//mybatis.org//DTD Config 3.0//EN" |
| "http://mybatis.org/dtd/mybatis-3-config.dtd"> |
| |
| <configuration> |
| |
| <typeAliases> |
| <package name="com.cmq.model"/> |
| </typeAliases> |
| <mappers> |
| <mapper class="com.cmq.mapper.StudentMapper"/> |
| </mappers> |
| |
| </configuration> |
MySQL5
| jdbc.driver:com.mysql.jdbc.Driver |
| jdbc.url:jdbc:mysql://localhost:3306/ssm |
| jdbc.username:root |
| jdbc.password:9999 |
MySQL8
| jdbc.driver=com.mysql.cj.jdbc.Driver |
| jdbc.url=jdbc:mysql://localhost:3306/ssm?serverTimezone=UTC |
| jdbc.username=root |
| jdbc.password=9999 |
| |
| <?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" xmlns:tx="http://www.springframework.org/schema/tx" |
| xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd http://www.springframework.org/schema/context https://www.springframework.org/schema/context/spring-context.xsd http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx.xsd"> |
| |
| |
| <context:component-scan base-package="com.cmq"> |
| <context:exclude-filter type="annotation" expression="org.springframework.stereotype.Controller"/> |
| </context:component-scan> |
| |
| |
| <context:property-placeholder location="classpath:jdbc.properties"/> |
| |
| |
| <bean id="dataSource" class="com.alibaba.druid.pool.DruidDataSource"> |
| <property name="driverClassName" value="${jdbc.driver}"></property> |
| <property name="url" value="${jdbc.url}"></property> |
| <property name="username" value="${jdbc.username}"></property> |
| <property name="password" value="${jdbc.password}"></property> |
| </bean> |
| |
| |
| |
| <bean id="transactionManager" class="org.springframework.jdbc.datasource.DataSourceTransactionManager"> |
| <property name="dataSource" ref="dataSource"></property> |
| </bean> |
| |
| |
| |
| |
| <tx:annotation-driven transaction-manager="transactionManager" /> |
| |
| |
| <bean id="sqlSessionFactory" class="org.mybatis.spring.SqlSessionFactoryBean"> |
| |
| <property name="dataSource" ref="dataSource"/> |
| |
| <property name="configLocation" value="classpath:mybatis-config.xml"/> |
| </bean> |
| |
| |
| |
| <bean class="org.mybatis.spring.mapper.MapperScannerConfigurer"> |
| |
| <property name="sqlSessionFactoryBeanName" value="sqlSessionFactory"/> |
| |
| <property name="basePackage" value="com.cmq.mapper"/> |
| </bean> |
| |
| </beans> |
| <?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" |
| xmlns:mvc="http://www.springframework.org/schema/mvc" |
| xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd http://www.springframework.org/schema/context https://www.springframework.org/schema/context/spring-context.xsd http://www.springframework.org/schema/mvc https://www.springframework.org/schema/mvc/spring-mvc.xsd"> |
| |
| |
| <mvc:annotation-driven/> |
| |
| <mvc:default-servlet-handler/> |
| |
| |
| <context:component-scan base-package="com.cmq.controller"/> |
| |
| <bean class="org.springframework.web.servlet.view.InternalResourceViewResolver" |
| id="internalResourceViewResolver"> |
| |
| <property name="prefix" value="/WEB-INF/jsp/"/> |
| |
| <property name="suffix" value=".jsp"/> |
| </bean> |
| |
| |
| |
| </beans> |
| |
| |
| |
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· 阿里巴巴 QwQ-32B真的超越了 DeepSeek R-1吗?
· 10年+ .NET Coder 心语 ── 封装的思维:从隐藏、稳定开始理解其本质意义
· 【设计模式】告别冗长if-else语句:使用策略模式优化代码结构
· 字符编码:从基础到乱码解决
· 提示词工程——AI应用必不可少的技术