前言
这是流水博文。
解决
ibatis传入整条sql语句办法:
<insert id="executeCpInsertSql" parameterClass="java.util.HashMap">
<isNotEmpty property="sql">$sql$</isNotEmpty>
</insert>
<update id="closeDbLink" parameterClass="java.util.HashMap">
<isNotEmpty property="sql">$sql$</isNotEmpty>
</update>
DAO:定义相应的方方法
DAO:
int closeDbLink(Map<String, Object> params);
DAOImpl:
public int closeDbLink(Map<String, Object> params){
return this.update("closeDbLink", params);
}
Action:查询时调用
Map<String, Object> closeLinkParams = new HashMap<String, Object>();
closeLinkParams.put("sql", "commit");
xxxxxDAO.closeDbLink(closeLinkParams);
该方法可以解决dblink操作导致连接数过多的问题!
select username, count(username) from v$session where username is not null group by username;
完。