Giter VIP home page Giter VIP logo

mybatis-spring's Introduction

#Spring整合MyBatis

####在控制台记录真实的sql语句

####使用log4jdbc的配置

######1、添加log4jdbc的jar

<dependency>
		<groupId>log4jdbc</groupId>
		<artifactId>log4jdbc4</artifactId>
		<version>1.2</version>
</dependency>
<dependency>
		<groupId>log4jdbc</groupId>
		<artifactId>log4jdbc4</artifactId>
		<version>1.2</version>
</dependency>
<dependency>
		<groupId>org.slf4j</groupId>
		<artifactId>slf4j-api</artifactId>
		<version>1.6.6</version>
</dependency>
<dependency>
		<groupId>org.slf4j</groupId>
		<artifactId>slf4j-log4j12</artifactId>
		<version>1.6.6</version>
</dependency>
<dependency>
		<groupId>org.slf4j</groupId>
		<artifactId>slf4j-jdk14</artifactId>
		<version>1.5.8</version>
</dependency>

######2、参考src/main/resources/log4j.properties配置文件

######3、修改jdbc的driver和jdbc url(参考src/main/resources/applicationContext.xml

<property name="driverClassName" value="net.sf.log4jdbc.DriverSpy"></property>
<property name="url" value="jdbc:log4jdbc:mysql://localhost:3306/mybatis"></property>

####使用p6spy的配置

######1、添加p6spy的jar

<dependency>
	<groupId>p6spy</groupId>
	<artifactId>p6spy</artifactId>
	<version>1.3</version>
</dependency>

######2、参考src/main/resources/spy.properties

######3、添加配置文件信息

<property name="driverClassName" value="com.p6spy.engine.spy.P6SpyDriver"></property>
<property name="url" value="jdbc:mysql://localhost:3306/mybatis"></property>

mybatis-spring's People

Contributors

v5tech avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.