<rt id="bn8ez"></rt>
<label id="bn8ez"></label>

  • <span id="bn8ez"></span>

    <label id="bn8ez"><meter id="bn8ez"></meter></label>

    Terry.Li-彬

    虛其心,可解天下之問;專其心,可治天下之學(xué);靜其心,可悟天下之理;恒其心,可成天下之業(yè)。

      BlogJava :: 首頁 :: 新隨筆 :: 聯(lián)系 :: 聚合  :: 管理 ::
      143 隨筆 :: 344 文章 :: 130 評論 :: 0 Trackbacks

    I'm using Spring 3.1.1, MyBatis 3.1.1, MySQL 5.0.67. My Spring configuration is below:

    				
    						<
    						bean id
    						=
    						"dataSource"
    						 class
    						=
    						"org.apache.tomcat.jdbc.pool.DataSource"
    						 destroy-method
    						=
    						"close"
    						>
    						
    						
    						<
    						property name
    						=
    						"driverClassName"
    						 value
    						=
    						"com.mysql.jdbc.Driver"
    						
    						
    						/>
    						
    						
    						<
    						property name
    						=
    						"url"
    						 value
    						=
    						"${jdbc.url}"
    						
    						
    						/>
    						
    						
    						<
    						property name
    						=
    						"username"
    						 value
    						=
    						"${jdbc.username}"
    						
    						
    						/>
    						
    						
    						<
    						property name
    						=
    						"password"
    						 value
    						=
    						"${jdbc.password}"
    						
    						
    						/>
    						
    						
    						<
    						property name
    						=
    						"validationQuery"
    						 value
    						=
    						"select 1"
    						/>
    						
    						
    						<
    						property name
    						=
    						"testWhileIdle"
    						 value
    						=
    						"true"
    						/>
    						
    						
    						<
    						property name
    						=
    						"timeBetweenEvictionRunsMillis"
    						 value
    						=
    						"14400000"
    						/>
    						
    						
    						<
    						property name
    						=
    						"testOnBorrow"
    						 value
    						=
    						"false"
    						/>
    						
    						
    						</
    						bean
    						>
    						
    						
    						<
    						bean id
    						=
    						"sqlSessionFactory"
    						 class
    						=
    						"org.mybatis.spring.SqlSessionFactoryBean"
    						>
    						
    						
    						<
    						property name
    						=
    						"dataSource"
    						 ref
    						=
    						"dataSource"
    						
    						
    						/>
    						
    						
    						<
    						property name
    						=
    						"configLocation"
    						 value
    						=
    						"classpath:mybatis/myBatisConfig.xml"
    						/>
    						
    						
    						</
    						bean
    						>
    						
    						
    						<
    						bean id
    						=
    						"sqlSessionTemplate"
    						 class
    						=
    						"org.mybatis.spring.SqlSessionTemplate"
    						>
    						
    						
    						<
    						constructor-arg ref
    						=
    						"sqlSessionFactory"
    						/>
    						
    						
    						</
    						bean
    						>
    						
    						
    						<
    						bean id
    						=
    						"transactionManager"
    						
        class
    						=
    						"org.springframework.jdbc.datasource.DataSourceTransactionManager"
    						
        p
    						:
    						dataSource-ref
    						=
    						"dataSource"
    						/>
    						
    						
    						<
    						tx
    						:
    						annotation-driven transaction-manager
    						=
    						"transactionManager"
    						/>

    And log4.properties is below:

    log4j . logger . org . springframework = DEBUG
    log4j
    . logger . org . apache = DEBUG
    log4j
    . logger . org . mybatis = DEBUG
    log4j
    . logger . java . sql = DEBUG
    log4j
    . logger . java . sql . Connection = DEBUG
    log4j
    . logger . java . sql . Statement = DEBUG
    log4j
    . logger . java . sql . PreparedStatement = DEBUG
    log4j
    . logger . java . sql . ResultSet = DEBUG

    With these configuration, I can see SQL query statement which is executed and parameters to that query but I can't see query result log. My log is like this:

    [ org . mybatis . spring . SqlSessionUtils ] - Creating a new SqlSession [ org . mybatis . spring . SqlSessionUtils ] - SqlSession

    [ org . apache . ibatis . session . defaults . DefaultSqlSession @ 4 ccdd1f ] was not registered for synchronization because synchronization is not active

    [
    org . springframework . jdbc . datasource . DataSourceUtils ] - Fetching JDBC Connection from DataSource

    [
    org . mybatis . spring . transaction . SpringManagedTransaction ] - JDBC Connection

    [
    ProxyConnection [ PooledConnection [ com . mysql . jdbc . JDBC4Connection @ 3 cfde82 ]]] will not be managed by Spring

    [
    java . sql . Connection ] - ooo Using Connection [ ProxyConnection [ PooledConnection [ com . mysql . jdbc . JDBC4Connection @ 3 cfde82 ]]]

    [
    java . sql . Connection ] - ==> Preparing : SELECT col FROM table WHERE col1 =? AND col2 =? [ java . sql . PreparedStatement ] - ==> Parameters : 93 ( Integer ), 4 ( Integer )

    [
    org . mybatis . spring . SqlSessionUtils ] - Closing non transactional SqlSession

    [
    org . apache . ibatis . session . defaults . DefaultSqlSession @ 4 ccdd1f ] [ org . springframework . jdbc . datasource . DataSourceUtils ] - Returning JDBC Connection to DataSource
    				
    posted on 2013-10-23 14:34 禮物 閱讀(822) 評論(0)  編輯  收藏

    只有注冊用戶登錄后才能發(fā)表評論。

    網(wǎng)站導(dǎo)航:
     
    主站蜘蛛池模板: 国产精品免费高清在线观看| 国产精品极品美女自在线观看免费 | 你懂得的在线观看免费视频| 男男gvh肉在线观看免费| www成人免费观看网站| 51在线视频免费观看视频| 成人免费视频网址| 亚洲人成人无码网www国产| 亚洲va在线va天堂va四虎| 亚洲一区二区观看播放| 一级毛片a免费播放王色电影| 久久精品免费一区二区| 亚洲国产成人久久一区久久| 亚洲国产模特在线播放| 一日本道a高清免费播放| 国产日产亚洲系列最新| 亚洲色少妇熟女11p| 日韩精品视频免费观看| 日韩va亚洲va欧洲va国产| 亚洲精品动漫免费二区| 污污网站免费观看| 亚洲精品美女久久久久99小说| 一级毛片免费在线观看网站| 亚洲国产第一站精品蜜芽| 日本片免费观看一区二区| 亚洲熟妇无码八V在线播放| 亚洲国产人成中文幕一级二级| 两个人看的www免费视频中文| 亚洲视频一区在线观看| 免费无码一区二区三区蜜桃| 亚洲国产成人精品无码久久久久久综合| 一区二区三区免费在线观看| 亚洲av色影在线| 毛片基地免费观看| 亚洲综合久久成人69| 久久午夜免费鲁丝片| 亚洲欧美自偷自拍另类视| 啦啦啦中文在线观看电视剧免费版| 亚洲第一se情网站| 国产精品公开免费视频| 亚洲丶国产丶欧美一区二区三区|