为什么大量的连接不能释放?
Oracle 9i的数据库
SELECT sql_text,COUNT(*) FROM v$sql s , v$session se WHERE se.prev_hash_value =s.hash_value GROUP BY sql_text
发现sql_text中大量的下面语句不能释放
select * from code_m where (name like '%吊坠% ' or key_word like '%吊坠% ') and name <> '吊坠 '
请问如何解决,附程序
public String getRelateKeyword(String name)throws NamingException,
SQLException {
String word= " ",tempStr= " ";
Connection conn=null;
PreparedStatement pstmt=null;
ResultSet rs=null;
try
{
conn=pool.getConnection();
tempStr=getKeywordbyName(name,conn);
String sql= "select * from code_m where (name like '% "+name+ "% ' or key_word like '% "+name+ "% ') and name <> ' "+name+ " ' ";
if(!tempStr.equals( " "))
sql= "select * from code_m where (name like '% "+name+ "% ' or key_word like '% "+tempStr+ "% ') and name <> ' "+name+ " ' ";
pstmt=conn.prepareStatement(sql);
rs=pstmt.executeQuery();
while(rs.next())
{
word+=rs.getString( "name ")+ ", ";
}
}finally{
pool.cleanup(conn,pstmt,rs);
}
return word;
}
------解决方案--------------------pool 是什么?
------解决方案--------------------pool是线程池...什么叫不能释放啊?直接释放CONNECTION不就完了吗?
------解决方案--------------------v$sql,v$session采用的是堆栈的机制,先进先出,实际