用的spring+ibatis,数据库是SQLServer。
有个疑问:在对数据库进行select、update、insert、del的操作时,数据库有没有返回一些信息?比如是对哪个表进行的什么操作。有没有什么方法能够取得这些信息?请高手指教,谢谢!!!

解决方案 »

  1.   

    因为用的ibatis,
    sql语句都写在xml里了,比如:
    <select id="getAppLeasePriceInfo" resultMap="appLeasePrice" parameterClass="appTotalSearchInfo">
        <![CDATA[
    select  
    count(case when f.leaseprice>=300.00 and f.leaseprice<600.00 then f.id end) as appLeasePrice1,
    count(case when f.leaseprice>=600.00 and f.leaseprice<900.00 then f.id end) as appLeasePrice2,
    count(case when f.leaseprice>=900.00 and f.leaseprice<1200.00 then f.id end) as appLeasePrice3,
    count(case when f.leaseprice>=1200.00 then f.id end) as appLeasePrice4
    ]]>
        from familytable f
      
       <dynamic prepend="WHERE">
        <isNotEmpty prepend="AND" property="appUserFlag">
    f.sectionname in ('1001','1002','1003','1004','1005','1006','1007','1008')
    </isNotEmpty>
            <isNotEmpty prepend="AND" property="appSectionName">
          f.sectionname = #appSectionName# 
         </isNotEmpty> 
            <isNotEmpty prepend="AND" property="appUserFlag">
          f.userflag = #appUserFlag# 
         </isNotEmpty>        
         <isNotEmpty prepend="AND" property="appHandleDateBegin">
          <![CDATA[f.finaldate >= #appHandleDateBegin#  ]]>   
         </isNotEmpty> 
         <isNotEmpty prepend="AND" property="appHandleDateEnd">
         <![CDATA[f.finaldate <= #appHandleDateEnd# ]]>   
         </isNotEmpty>   
        </dynamic>
      </select>像这样的情况,我想在执行前拦截一下将要对哪些表的哪些列进行操作。有可能做到么?