Spring3.2.8+Mybatis3.2.6+Maven 整合配置

本文涉及的产品
RDS MySQL Serverless 基础系列,0.5-2RCU 50GB
云数据库 RDS MySQL,集群系列 2核4GB
推荐场景:
搭建个人博客
RDS MySQL Serverless 高可用系列,价值2615元额度,1个月
简介:


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
<?xml version= "1.0"  encoding= "UTF-8" ?>
<beans  default -autowire= "byName"
        xmlns= "http://www.springframework.org/schema/beans"
        xmlns:xsi= "http://www.w3.org/2001/XMLSchema-instance"
        xsi:schemaLocation="http: //www.springframework.org/schema/beans
             http: //www.springframework.org/schema/beans/spring-beans.xsd
             http: //www.springframework.org/schema/tx
             http: //www.springframework.org/schema/tx/spring-tx.xsd
             http: //www.springframework.org/schema/aop
             http: //www.springframework.org/schema/aop/spring-aop.xsd
             http: //www.springframework.org/schema/context
             http: //www.springframework.org/schema/context/spring-context.xsd"
        xmlns:tx= "http://www.springframework.org/schema/tx"
        xmlns:aop= "http://www.springframework.org/schema/aop"
        xmlns:context= "http://www.springframework.org/schema/context" >
     <context:annotation-config/>
     <context:property-placeholder location= "classpath*:jdbc.properties" />
     <!-- 配置系统的数据源 -->
     <bean id= "dataSource"  class = "com.alibaba.druid.pool.DruidDataSource"  init-method= "init"  destroy-method= "close" >
         <property name= "driverClassName"  value= "${driver}" />
         <property name= "url"  value= "${url}" />
         <property name= "username"  value= "root" />
         <property name= "password"  value= "leizm" />
         <property name= "filters"  value= "stat" />
         <property name= "maxActive"  value= "10" />
         <property name= "initialSize"  value= "1" />
         <property name= "maxWait"  value= "60000" />
         <property name= "minIdle"  value= "1" />
         <property name= "timeBetweenEvictionRunsMillis"  value= "60000" />
         <property name= "minEvictableIdleTimeMillis"  value= "300000" />
         <property name= "validationQuery"  value= "SELECT 'x'" />
         <property name= "testWhileIdle"  value= "true" />
         <property name= "testOnBorrow"  value= "false" />
         <property name= "testOnReturn"  value= "false" />
         <property name= "poolPreparedStatements"  value= "true" />
         <property name= "maxPoolPreparedStatementPerConnectionSize"  value= "50" />
         <property name= "maxOpenPreparedStatements"  value= "100" />
     </bean>
     <bean id= "sqlSessionFactory"  class = "org.mybatis.spring.SqlSessionFactoryBean" >
         <property name= "configLocation"  value= "classpath:mybatis-config.xml" />
         <property name= "mapperLocations"  value= "classpath:/com/lavasoft/demo/entity/*.xml" />
         <property name= "dataSource"  ref= "dataSource" />
     </bean>
     <!-- 事务管理器配置,单数据源事务 -->
     <bean id= "transactionManager"  class = "org.springframework.jdbc.datasource.DataSourceTransactionManager" >
         <property name= "dataSource"  ref= "dataSource" />
     </bean>
     <!-- 配置那些类的方法进行事务管理 -->
     <aop:config>
         <aop:pointcut id= "executeService"  expression= "execution(* com.lavasoft.*.service..*(..))" />
         <aop:advisor pointcut-ref= "executeService"  advice-ref= "txAdvice" />
     </aop:config>
     <tx:advice id= "txAdvice"  transaction-manager= "transactionManager" >
         <tx:attributes>
             <tx:method name= "select*"  read-only= "true" />
             <tx:method name= "get*"  read-only= "true" />
             <tx:method name= "load*"  read-only= "true" />
             <tx:method name= "find*"  read-only= "true" />
             <tx:method name= "query*"  read-only= "true" />
             <tx:method name= "read*"  read-only= "true" />
             <tx:method name= "sync*" />
             <tx:method name= "*"  propagation= "REQUIRED"  rollback- for = "java.lang.Exception" />
         </tx:attributes>
     </tx:advice>
     <context:component-scan base- package = "com.lavasoft.demo.dao"  resource-pattern= "*DAO.class" />
     <context:component-scan base- package = "com.lavasoft.demo.service" />
</beans>




1
2
3
4
5
6
7
8
9
10
11
<?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.lavasoft.demo.entity" />
     </typeAliases>
     <plugins>
         <plugin interceptor= "com.lavasoft.framework.ext.interceptor.PageInterceptor" />
     </plugins>
</configuration>


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
<?xml version= "1.0"  encoding= "UTF-8" ?>
<project xmlns= "http://maven.apache.org/POM/4.0.0"
          xmlns:xsi= "http://www.w3.org/2001/XMLSchema-instance"
          xsi:schemaLocation= "http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" >
     <modelVersion> 4.0 . 0 </modelVersion>
     <groupId>jeefw</groupId>
     <artifactId>jeefw</artifactId>
     <version> 1.0 -SNAPSHOT</version>
     <properties>
         <spring.version> 3.2 . 8 .RELEASE</spring.version>
         <struts2.version> 2.3 . 16.1 </struts2.version>
         <hibernate.version> 4.3 . 4 .Final</hibernate.version>
         <mybatis.version> 3.2 . 6 </mybatis.version>
         <mysql.version> 5.1 . 29 </mysql.version>
         <ojdbc14.version> 10.2 . 0.4 . 0 </ojdbc14.version>
         <servlet-api.version> 2.5 </servlet-api.version>
         <jsp-api.version> 2.2 </jsp-api.version>
         <jstl.version> 1.2 </jstl.version>
         <fastjson.version> 1.1 . 39 </fastjson.version>
         <commons-dbcp2.version> 2.0 </commons-dbcp2.version>
         <commons-pool2.version> 2.2 </commons-pool2.version>
         <commons-logging.version> 1.1 . 3 </commons-logging.version>
         <commons-io.version> 1.3 . 2 </commons-io.version>
         <commons-lang3.version> 3.3 . 1 </commons-lang3.version>
         <commons-fileupload.version> 1.2 . 1 </commons-fileupload.version>
         <log4j.version> 1.2 . 17 </log4j.version>
         <slf4j.version> 1.7 . 6 </slf4j.version>
         <dom4j.version> 1.6 . 1 </dom4j.version>
         <jfreechart.version> 1.0 . 17 </jfreechart.version>
         <shiro.version> 1.2 . 3 </shiro.version>
         <aspectjweaver.version> 1.7 . 4 </aspectjweaver.version>
         <bonecp.version> 0.8 . 0 .RELEASE</bonecp.version>
         <druid.version> 1.0 . 4 </druid.version>
         <c3p0.version> 0.9 . 2.1 </c3p0.version>
         <testng.version> 6.8 . 8 </testng.version>
         <junit.version> 4.11 </junit.version>
         <freemarker.version> 2.3 . 20 </freemarker.version>
         <velocity.version> 1.7 </velocity.version>
         <tapestry.version> 5.3 . 7 </tapestry.version>
         <asm.version> 4.2 </asm.version>
         <cglib.version> 3.1 </cglib.version>
         <!-- Plugin的属性定义 -->
         <project.build.sourceEncoding>UTF- 8 </project.build.sourceEncoding>
         <jdk.version> 1.6 </jdk.version>
     </properties>
     <dependencies>
         <!-- mybaits -->
         <dependency>
             <groupId>org.mybatis</groupId>
             <artifactId>mybatis</artifactId>
             <version>${mybatis.version}</version>
         </dependency>
         <dependency>
             <groupId>org.mybatis</groupId>
             <artifactId>mybatis-spring</artifactId>
             <version> 1.2 . 2 </version>
         </dependency>
         <dependency>
             <groupId>org.mybatis.caches</groupId>
             <artifactId>mybatis-ehcache</artifactId>
             <version> 1.0 . 2 </version>
         </dependency>
         <!-- JDBC驱动 -->
         <dependency>
             <groupId>mysql</groupId>
             <artifactId>mysql-connector-java</artifactId>
             <version>${mysql.version}</version>
         </dependency>
         <!-- spring相关 -->
         <dependency>
             <groupId>org.springframework</groupId>
             <artifactId>spring-core</artifactId>
             <version>${spring.version}</version>
         </dependency>
         <dependency>
             <groupId>org.springframework</groupId>
             <artifactId>spring-beans</artifactId>
             <version>${spring.version}</version>
         </dependency>
         <dependency>
             <groupId>org.springframework</groupId>
             <artifactId>spring-context</artifactId>
             <version>${spring.version}</version>
         </dependency>
         <dependency>
             <groupId>org.springframework</groupId>
             <artifactId>spring-jdbc</artifactId>
             <version>${spring.version}</version>
         </dependency>
         <dependency>
             <groupId>org.springframework</groupId>
             <artifactId>spring-web</artifactId>
             <version>${spring.version}</version>
         </dependency>
         <dependency>
             <groupId>org.springframework</groupId>
             <artifactId>spring-webmvc</artifactId>
             <version>${spring.version}</version>
         </dependency>
         <dependency>
             <groupId>org.springframework</groupId>
             <artifactId>spring-aop</artifactId>
             <version>${spring.version}</version>
         </dependency>
         <dependency>
             <groupId>org.springframework</groupId>
             <artifactId>spring-tx</artifactId>
             <version>${spring.version}</version>
         </dependency>
         <dependency>
             <groupId>org.springframework</groupId>
             <artifactId>spring-orm</artifactId>
             <version>${spring.version}</version>
         </dependency>
         <dependency>
             <groupId>org.springframework</groupId>
             <artifactId>spring-context-support</artifactId>
             <version>${spring.version}</version>
         </dependency>
         <dependency>
             <groupId>org.springframework</groupId>
             <artifactId>spring-test</artifactId>
             <version>${spring.version}</version>
         </dependency>
         <dependency>
             <groupId>org.springframework</groupId>
             <artifactId>spring-jms</artifactId>
             <version>${spring.version}</version>
         </dependency>
         <!-- json库 -->
         <!-- 模板库 -->
         <dependency>
             <groupId>org.freemarker</groupId>
             <artifactId>freemarker</artifactId>
             <version>${freemarker.version}</version>
         </dependency>
         <!-- 日志库 -->
         <dependency>
             <groupId>commons-logging</groupId>
             <artifactId>commons-logging</artifactId>
             <version>${commons-logging.version}</version>
         </dependency>
         <dependency>
             <groupId>log4j</groupId>
             <artifactId>log4j</artifactId>
             <version>${log4j.version}</version>
         </dependency>
         <dependency>
             <groupId>org.slf4j</groupId>
             <artifactId>slf4j-log4j12</artifactId>
             <version>${slf4j.version}</version>
         </dependency>
         <dependency>
             <groupId>org.slf4j</groupId>
             <artifactId>slf4j-api</artifactId>
             <version>${slf4j.version}</version>
         </dependency>
         <!-- 依赖的WEB类库-->
         <dependency>
             <groupId>javax.servlet.jsp</groupId>
             <artifactId>jsp-api</artifactId>
             <version>${jsp-api.version}</version>
         </dependency>
         <dependency>
             <groupId>javax.servlet</groupId>
             <artifactId>servlet-api</artifactId>
             <version>${servlet-api.version}</version>
         </dependency>
         <dependency>
             <groupId>javax.servlet</groupId>
             <artifactId>jstl</artifactId>
             <version>${jstl.version}</version>
         </dependency>
         <!-- 依赖的测试类库-->
         <dependency>
             <groupId>org.springframework</groupId>
             <artifactId>spring-test</artifactId>
             <version>${spring.version}</version>
         </dependency>
         <dependency>
             <groupId>junit</groupId>
             <artifactId>junit</artifactId>
             <version>${junit.version}</version>
         </dependency>
         <dependency>
             <groupId>org.testng</groupId>
             <artifactId>testng</artifactId>
             <version>${testng.version}</version>
         </dependency>
         <!-- 连接池 -->
         <dependency>
             <groupId>com.alibaba</groupId>
             <artifactId>druid</artifactId>
             <version>${druid.version}</version>
         </dependency>
         <!-- shiro权限控制 -->
         <dependency>
             <groupId>org.apache.shiro</groupId>
             <artifactId>shiro-core</artifactId>
             <version>${shiro.version}</version>
         </dependency>
         <dependency>
             <groupId>org.apache.shiro</groupId>
             <artifactId>shiro-web</artifactId>
             <version>${shiro.version}</version>
         </dependency>
         <dependency>
             <groupId>org.apache.shiro</groupId>
             <artifactId>shiro-spring</artifactId>
             <version>${shiro.version}</version>
         </dependency>
         <dependency>
             <groupId>org.apache.shiro</groupId>
             <artifactId>shiro-ehcache</artifactId>
             <version>${shiro.version}</version>
         </dependency>
         <dependency>
             <groupId>org.apache.shiro</groupId>
             <artifactId>shiro-aspectj</artifactId>
             <version>${shiro.version}</version>
         </dependency>
         <dependency>
             <groupId>org.apache.shiro</groupId>
             <artifactId>shiro-quartz</artifactId>
             <version>${shiro.version}</version>
         </dependency>
         <!-- 模板技术 -->
         <dependency>
             <groupId>org.freemarker</groupId>
             <artifactId>freemarker</artifactId>
             <version>${freemarker.version}</version>
         </dependency>
         <dependency>
             <groupId>org.apache.velocity</groupId>
             <artifactId>velocity</artifactId>
             <version>${velocity.version}</version>
         </dependency>
         <!-- 依赖的公共类库-->
         <dependency>
             <groupId>org.apache.commons</groupId>
             <artifactId>commons-io</artifactId>
             <version>${commons-io.version}</version>
         </dependency>
         <dependency>
             <groupId>org.apache.commons</groupId>
             <artifactId>commons-lang3</artifactId>
             <version>${commons-lang3.version}</version>
         </dependency>
         <dependency>
             <groupId>org.apache.commons</groupId>
             <artifactId>commons-collections4</artifactId>
             <version> 4.0 </version>
         </dependency>
         <dependency>
             <groupId>org.kuali.commons</groupId>
             <artifactId>commons-beanutils</artifactId>
             <version> 1.8 . 3 -kuali- 4 </version>
         </dependency>
         <!-- 缓存 -->
         <dependency>
             <groupId>net.sf.ehcache</groupId>
             <artifactId>ehcache</artifactId>
             <version> 2.8 . 1 </version>
         </dependency>
         <!-- 其他 -->
         <dependency>
             <groupId>com.alibaba</groupId>
             <artifactId>fastjson</artifactId>
             <version>${fastjson.version}</version>
         </dependency>
         <dependency>
             <groupId>org.aspectj</groupId>
             <artifactId>aspectjweaver</artifactId>
             <version>${aspectjweaver.version}</version>
         </dependency>
         <dependency>
             <groupId>dom4j</groupId>
             <artifactId>dom4j</artifactId>
             <version>${dom4j.version}</version>
         </dependency>
         <dependency>
             <groupId>com.belerweb</groupId>
             <artifactId>pinyin4j</artifactId>
             <version> 2.5 . 0 </version>
         </dependency>
         <dependency>
             <groupId>com.darwinsys</groupId>
             <artifactId>hirondelle-date4j</artifactId>
             <version> 1.5 . 1 </version>
         </dependency>
     </dependencies>
     <build>
         <finalName>chapter1</finalName>
         <plugins>
             <plugin>
                 <artifactId>maven-surefire-plugin</artifactId>
                 <configuration>
                     <skip> true </skip>
                 </configuration>
             </plugin>
             <!-- jetty插件 -->
             <plugin>
                 <groupId>org.mortbay.jetty</groupId>
                 <artifactId>maven-jetty-plugin</artifactId>
                 <version> 6.1 . 5 </version>
                 <configuration>
                     <webAppSourceDirectory>src/main/webapp</webAppSourceDirectory>
                     <scanIntervalSeconds> 3 </scanIntervalSeconds>
                     <contextPath>/chapter1</contextPath>
                     <connectors>
                         <connector implementation= "org.mortbay.jetty.nio.SelectChannelConnector" >
                             <port> 8088 </port>
                         </connector>
                     </connectors>
                 </configuration>
             </plugin>
         </plugins>
     </build>
</project>



测试一把:


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
D:\jdk1.6.0_45\bin\java -Didea.launcher.port=7532 -Didea.launcher.bin.path=C:\IDEA.13.0.1\bin -Dfile.encoding=UTF-8 -classpath D:\jdk1.6.0_45\jre\lib\charsets.jar;D:\jdk1.6.0_45\jre\lib\deploy.jar;D:\jdk1.6.0_45\jre\lib\javaws.jar;D:\jdk1.6.0_45\jre\lib\jce.jar;D:\jdk1.6.0_45\jre\lib\jsse.jar;D:\jdk1.6.0_45\jre\lib\management-agent.jar;D:\jdk1.6.0_45\jre\lib\plugin.jar;D:\jdk1.6.0_45\jre\lib\resources.jar;D:\jdk1.6.0_45\jre\lib\rt.jar;D:\jdk1.6.0_45\jre\lib\ext\dnsns.jar;D:\jdk1.6.0_45\jre\lib\ext\localedata.jar;D:\jdk1.6.0_45\jre\lib\ext\sunjce_provider.jar;D:\jdk1.6.0_45\jre\lib\ext\sunmscapi.jar;D:\jdk1.6.0_45\jre\lib\ext\sunpkcs11.jar;D:\IdeaProjects\basefw\mybatisext\target\classes;D:\IdeaProjects\basefw\mybatisext\src\lib\javacsv.jar;D:\IdeaProjects\basefw\mybatisext\src\lib\sac-1.3.jar;D:\IdeaProjects\basefw\mybatisext\src\lib\junit-4.4.jar;D:\IdeaProjects\basefw\mybatisext\src\lib\freemarker.jar;D:\IdeaProjects\basefw\mybatisext\src\lib\aopalliance.jar;D:\IdeaProjects\basefw\mybatisext\src\lib\jsoup-1.7.2.jar;D:\IdeaProjects\basefw\mybatisext\src\lib\xalan-2.7.1.jar;D:\IdeaProjects\basefw\mybatisext\src\lib\commons-dbcp.jar;D:\IdeaProjects\basefw\mybatisext\src\lib\commons-pool.jar;D:\IdeaProjects\basefw\mybatisext\src\lib\log4j-1.2.15.jar;D:\IdeaProjects\basefw\mybatisext\src\lib\aspectjweaver.jar;D:\IdeaProjects\basefw\mybatisext\src\lib\htmlunit-2.10.jar;D:\IdeaProjects\basefw\mybatisext\src\lib\mybatis-3.2.6.jar;D:\IdeaProjects\basefw\mybatisext\src\lib\commons-io-2.2.jar;D:\IdeaProjects\basefw\mybatisext\src\lib\httpcore-4.2.1.jar;D:\IdeaProjects\basefw\mybatisext\src\lib\httpmime-4.2.1.jar;D:\IdeaProjects\basefw\mybatisext\src\lib\commons-logging.jar;D:\IdeaProjects\basefw\mybatisext\src\lib\cssparser-0.9.7.jar;D:\IdeaProjects\basefw\mybatisext\src\lib\nekohtml-1.9.16.jar;D:\IdeaProjects\basefw\mybatisext\src\lib\xml-apis-1.3.04.jar;D:\IdeaProjects\basefw\mybatisext\src\lib\httpclient-4.2.1.jar;D:\IdeaProjects\basefw\mybatisext\src\lib\ibatis-2.3.4.726.jar;D:\IdeaProjects\basefw\mybatisext\src\lib\serializer-2.7.1.jar;D:\IdeaProjects\basefw\mybatisext\src\lib\xercesImpl-2.9.1.jar;D:\IdeaProjects\basefw\mybatisext\src\lib\commons-beanutils.jar;D:\IdeaProjects\basefw\mybatisext\src\lib\commons-codec-1.6.jar;D:\IdeaProjects\basefw\mybatisext\src\lib\commons-lang3-3.1.jar;D:\IdeaProjects\basefw\mybatisext\src\lib\jsoup-1.7.2-javadoc.jar;D:\IdeaProjects\basefw\mybatisext\src\lib\jsoup-1.7.2-sources.jar;D:\IdeaProjects\basefw\mybatisext\src\lib\mybatis-spring-1.2.2.jar;D:\IdeaProjects\basefw\mybatisext\src\lib\htmlunit-core-js-2.10.jar;D:\IdeaProjects\basefw\mybatisext\src\lib\commons-collections-3.2.1.jar;D:\IdeaProjects\basefw\mybatisext\src\lib\javax.servlet.jsp.jstl-1.2.1.jar;D:\IdeaProjects\basefw\mybatisext\src\lib\mysql-connector-java-5.1.17-bin.jar;D:\IdeaProjects\basefw\mybatisext\src\lib\javax.servlet.jsp.jstl-api-1.2.1.jar;D:\IdeaProjects\basefw\mybatisext\src\lib\fastjson-1.1.15-20120106.101821-4.jar;D:\IdeaProjects\basefw\mybatisext\src\lib\org.springframework.aop-3.1.2.RELEASE.jar;D:\IdeaProjects\basefw\mybatisext\src\lib\org.springframework.asm-3.1.2.RELEASE.jar;D:\IdeaProjects\basefw\mybatisext\src\lib\org.springframework.jms-3.1.2.RELEASE.jar;D:\IdeaProjects\basefw\mybatisext\src\lib\org.springframework.orm-3.1.2.RELEASE.jar;D:\IdeaProjects\basefw\mybatisext\src\lib\org.springframework.oxm-3.1.2.RELEASE.jar;D:\IdeaProjects\basefw\mybatisext\src\lib\org.springframework.web-3.1.2.RELEASE.jar;D:\IdeaProjects\basefw\mybatisext\src\lib\org.springframework.core-3.1.2.RELEASE.jar;D:\IdeaProjects\basefw\mybatisext\src\lib\org.springframework.jdbc-3.1.2.RELEASE.jar;D:\IdeaProjects\basefw\mybatisext\src\lib\org.springframework.test-3.1.2.RELEASE.jar;D:\IdeaProjects\basefw\mybatisext\src\lib\org.springframework.beans-3.1.2.RELEASE.jar;D:\IdeaProjects\basefw\mybatisext\src\lib\org.springframework.aspects-3.1.2.RELEASE.jar;D:\IdeaProjects\basefw\mybatisext\src\lib\org.springframework.context-3.1.2.RELEASE.jar;D:\IdeaProjects\basefw\mybatisext\src\lib\org.springframework.expression-3.1.2.RELEASE.jar;D:\IdeaProjects\basefw\mybatisext\src\lib\org.springframework.instrument-3.1.2.RELEASE.jar;D:\IdeaProjects\basefw\mybatisext\src\lib\org.springframework.web.struts-3.1.2.RELEASE.jar;D:\IdeaProjects\basefw\mybatisext\src\lib\org.springframework.transaction-3.1.2.RELEASE.jar;D:\IdeaProjects\basefw\mybatisext\src\lib\org.springframework.web.portlet-3.1.2.RELEASE.jar;D:\IdeaProjects\basefw\mybatisext\src\lib\org.springframework.web.servlet-3.1.2.RELEASE.jar;D:\IdeaProjects\basefw\mybatisext\src\lib\org.springframework.context.support-3.1.2.RELEASE.jar;D:\IdeaProjects\basefw\mybatisext\src\lib\org.springframework.instrument.tomcat-3.1.2.RELEASE.jar;C:\IDEA.13.0.1\lib\idea_rt.jar com.intellij.rt.execution.application.AppMain com.lavasoft.demo.service.PersonSVImpl
2014-04-02 16:20:25 org.apache.ibatis.logging.commons.JakartaCommonsLoggingImpl.debug(JakartaCommonsLoggingImpl.java:49)  Parsed configuration file:  'class path resource [mybatis-config.xml]'
2014-04-02 16:20:25 org.apache.ibatis.logging.commons.JakartaCommonsLoggingImpl.debug(JakartaCommonsLoggingImpl.java:49)  Parsed mapper file:  'file [D:\IdeaProjects\basefw\mybatisext\target\classes\com\lavasoft\demo\entity\Address.xml]'
2014-04-02 16:20:25 org.apache.ibatis.logging.commons.JakartaCommonsLoggingImpl.debug(JakartaCommonsLoggingImpl.java:49)  Parsed mapper file:  'file [D:\IdeaProjects\basefw\mybatisext\target\classes\com\lavasoft\demo\entity\Extinfo.xml]'
2014-04-02 16:20:25 org.apache.ibatis.logging.commons.JakartaCommonsLoggingImpl.debug(JakartaCommonsLoggingImpl.java:49)  Parsed mapper file:  'file [D:\IdeaProjects\basefw\mybatisext\target\classes\com\lavasoft\demo\entity\Menu.xml]'
2014-04-02 16:20:25 org.apache.ibatis.logging.commons.JakartaCommonsLoggingImpl.debug(JakartaCommonsLoggingImpl.java:49)  Parsed mapper file:  'file [D:\IdeaProjects\basefw\mybatisext\target\classes\com\lavasoft\demo\entity\Orders.xml]'
2014-04-02 16:20:25 org.apache.ibatis.logging.commons.JakartaCommonsLoggingImpl.debug(JakartaCommonsLoggingImpl.java:49)  Parsed mapper file:  'file [D:\IdeaProjects\basefw\mybatisext\target\classes\com\lavasoft\demo\entity\Person.xml]'
>>>>>>:jdbc:mysql: //localhost:3306/testdb, UserName=root@localhost, MySQL-AB JDBC Driver
2014-04-02 16:20:26 org.apache.ibatis.logging.commons.JakartaCommonsLoggingImpl.debug(JakartaCommonsLoggingImpl.java:49)  Creating a  new  SqlSession
2014-04-02 16:20:26 org.apache.ibatis.logging.commons.JakartaCommonsLoggingImpl.debug(JakartaCommonsLoggingImpl.java:49)  Registering transaction synchronization  for  SqlSession [org.apache.ibatis.session.defaults.DefaultSqlSession@4c6320]
2014-04-02 16:20:26 org.apache.ibatis.logging.commons.JakartaCommonsLoggingImpl.debug(JakartaCommonsLoggingImpl.java:49)  JDBC Connection [jdbc:mysql: //localhost:3306/testdb, UserName=root@localhost, MySQL-AB JDBC Driver] will be managed by Spring
2014-04-02 16:20:26 org.apache.ibatis.logging.commons.JakartaCommonsLoggingImpl.debug(JakartaCommonsLoggingImpl.java:49)  ==>  Preparing: insert into person(name,pswd) values(?,?)
2014-04-02 16:20:26 org.apache.ibatis.logging.commons.JakartaCommonsLoggingImpl.debug(JakartaCommonsLoggingImpl.java:49)  ==> Parameters: 测试插入asdfasd(String), asdf(String)
2014-04-02 16:20:26 org.apache.ibatis.logging.commons.JakartaCommonsLoggingImpl.debug(JakartaCommonsLoggingImpl.java:49)  <==    Updates: 1
2014-04-02 16:20:26 org.apache.ibatis.logging.commons.JakartaCommonsLoggingImpl.debug(JakartaCommonsLoggingImpl.java:49)  Releasing transactional SqlSession [org.apache.ibatis.session.defaults.DefaultSqlSession@4c6320]
Person{id=68, name= '测试插入asdfasd' , pswd= 'asdf' }
>>>>>>:jdbc:mysql: //localhost:3306/testdb, UserName=root@localhost, MySQL-AB JDBC Driver
2014-04-02 16:20:26 org.apache.ibatis.logging.commons.JakartaCommonsLoggingImpl.debug(JakartaCommonsLoggingImpl.java:49)  Fetched SqlSession [org.apache.ibatis.session.defaults.DefaultSqlSession@4c6320] from current transaction
2014-04-02 16:20:26 org.apache.ibatis.logging.commons.JakartaCommonsLoggingImpl.debug(JakartaCommonsLoggingImpl.java:49)  ==>  Preparing: insert into extinfo(personid,email,qq) values(?,?,?)
2014-04-02 16:20:26 org.apache.ibatis.logging.commons.JakartaCommonsLoggingImpl.debug(JakartaCommonsLoggingImpl.java:49)  ==> Parameters: 68(Long), test@test.com(String), 234232343(Long)
2014-04-02 16:20:26 org.apache.ibatis.logging.commons.JakartaCommonsLoggingImpl.debug(JakartaCommonsLoggingImpl.java:49)  <==    Updates: 1
2014-04-02 16:20:26 org.apache.ibatis.logging.commons.JakartaCommonsLoggingImpl.debug(JakartaCommonsLoggingImpl.java:49)  Releasing transactional SqlSession [org.apache.ibatis.session.defaults.DefaultSqlSession@4c6320]
Extinfo{id=29, personid=68, email= 'test@test.com' , qq=234232343}
2014-04-02 16:20:26 org.apache.ibatis.logging.commons.JakartaCommonsLoggingImpl.debug(JakartaCommonsLoggingImpl.java:49)  Transaction synchronization committing SqlSession [org.apache.ibatis.session.defaults.DefaultSqlSession@4c6320]
2014-04-02 16:20:26 org.apache.ibatis.logging.commons.JakartaCommonsLoggingImpl.debug(JakartaCommonsLoggingImpl.java:49)  Transaction synchronization deregistering SqlSession [org.apache.ibatis.session.defaults.DefaultSqlSession@4c6320]
2014-04-02 16:20:26 org.apache.ibatis.logging.commons.JakartaCommonsLoggingImpl.debug(JakartaCommonsLoggingImpl.java:49)  Transaction synchronization closing SqlSession [org.apache.ibatis.session.defaults.DefaultSqlSession@4c6320]
Process finished with  exit  code 0




本文转自 leizhimin 51CTO博客,原文链接:http://blog.51cto.com/lavasoft/1389190,如需转载请自行联系原作者


相关实践学习
如何在云端创建MySQL数据库
开始实验后,系统会自动创建一台自建MySQL的 源数据库 ECS 实例和一台 目标数据库 RDS。
全面了解阿里云能为你做什么
阿里云在全球各地部署高效节能的绿色数据中心,利用清洁计算为万物互联的新世界提供源源不断的能源动力,目前开服的区域包括中国(华北、华东、华南、香港)、新加坡、美国(美东、美西)、欧洲、中东、澳大利亚、日本。目前阿里云的产品涵盖弹性计算、数据库、存储与CDN、分析与搜索、云通信、网络、管理与监控、应用服务、互联网中间件、移动服务、视频服务等。通过本课程,来了解阿里云能够为你的业务带来哪些帮助 &nbsp; &nbsp; 相关的阿里云产品:云服务器ECS 云服务器 ECS(Elastic Compute Service)是一种弹性可伸缩的计算服务,助您降低 IT 成本,提升运维效率,使您更专注于核心业务创新。产品详情: https://www.aliyun.com/product/ecs
相关文章
|
23天前
|
Java 开发者 微服务
手写模拟Spring Boot自动配置功能
【11月更文挑战第19天】随着微服务架构的兴起,Spring Boot作为一种快速开发框架,因其简化了Spring应用的初始搭建和开发过程,受到了广大开发者的青睐。自动配置作为Spring Boot的核心特性之一,大大减少了手动配置的工作量,提高了开发效率。
43 0
|
2月前
|
Java API 数据库
Spring Boot框架因其简洁的配置、快速的启动特性及丰富的功能集而备受开发者青睐
本文通过在线图书管理系统案例,详细介绍如何使用Spring Boot构建RESTful API。从项目基础环境搭建、实体类与数据访问层定义,到业务逻辑实现和控制器编写,逐步展示了Spring Boot的简洁配置和强大功能。最后,通过Postman测试API,并介绍了如何添加安全性和异常处理,确保API的稳定性和安全性。
40 0
|
2月前
|
Java API Spring
在 Spring 配置文件中配置 Filter 的步骤
【10月更文挑战第21天】在 Spring 配置文件中配置 Filter 是实现请求过滤的重要手段。通过合理的配置,可以灵活地对请求进行处理,满足各种应用需求。还可以根据具体的项目要求和实际情况,进一步深入研究和优化 Filter 的配置,以提高应用的性能和安全性。
|
14天前
|
Java 数据库连接 数据库
spring和Mybatis的逆向工程
通过本文的介绍,我们了解了如何使用Spring和MyBatis进行逆向工程,包括环境配置、MyBatis Generator配置、Spring和MyBatis整合以及业务逻辑的编写。逆向工程极大地提高了开发效率,减少了重复劳动,保证了代码的一致性和可维护性。希望这篇文章能帮助你在项目中高效地使用Spring和MyBatis。
9 1
|
1月前
|
Java Spring
[Spring]aop的配置与使用
本文介绍了AOP(面向切面编程)的基本概念和核心思想。AOP是Spring框架的核心功能之一,通过动态代理在不修改原代码的情况下注入新功能。文章详细解释了连接点、切入点、通知、切面等关键概念,并列举了前置通知、后置通知、最终通知、异常通知和环绕通知五种通知类型。
30 1
|
2月前
|
Java BI 调度
Java Spring的定时任务的配置和使用
遵循上述步骤,你就可以在Spring应用中轻松地配置和使用定时任务,满足各种定时处理需求。
150 1
|
Java Apache Maven
【Spring】Maven的安装
【Spring】Maven的安装
147 0
【Spring】Maven的安装
|
Java Maven Spring
【Spring】Maven的安装
转载请注明出处:http://blog.csdn.net/qq_26525215 本文源自【大学之旅_谙忆的博客】 首先,先介绍下Maven是啥吧。 Apache Maven 是一个软件项目管理工具,基于项目对象模型(Project Object Model,POM)的概念,Maven可用来管理项目的依赖、编译、文档等信息。
753 0
|
3月前
|
SQL 监控 druid
springboot-druid数据源的配置方式及配置后台监控-自定义和导入stater(推荐-简单方便使用)两种方式配置druid数据源
这篇文章介绍了如何在Spring Boot项目中配置和监控Druid数据源,包括自定义配置和使用Spring Boot Starter两种方法。
|
2月前
|
人工智能 自然语言处理 前端开发
SpringBoot + 通义千问 + 自定义React组件:支持EventStream数据解析的技术实践
【10月更文挑战第7天】在现代Web开发中,集成多种技术栈以实现复杂的功能需求已成为常态。本文将详细介绍如何使用SpringBoot作为后端框架,结合阿里巴巴的通义千问(一个强大的自然语言处理服务),并通过自定义React组件来支持服务器发送事件(SSE, Server-Sent Events)的EventStream数据解析。这一组合不仅能够实现高效的实时通信,还能利用AI技术提升用户体验。
193 2

推荐镜像

更多