我是用java直接连的://连接类:
private static ComboPooledDataSource condb;
static {
try {
condb = new ComboPooledDataSource();
condb.setDriverClass("oracle.jdbc.driver.OracleDriver";
condb.setJdbcUrl("jdbcracle:thin192.168.0.1:1521:db";
condb.setUser("db";
condb.setPassword("db";
condb.setAcquireIncrement(1);
condb.setMaxPoolSize(100);
condb.setMinPoolSize(2);
condb.setInitialPoolSize(2);
} catch (Exception ex) {ex.printStackTrace();}
}
//===================================================//调用类初始化:
public static Connection getConnection() throws Exception {
return condb.getConnection();
}
//----------------------下面是操作调用:---------------------------------
try {
con = DBCon.getConnection();
pst = con.prepareStatement("select * from manage order by id desc");
rs = pst.executeQuery();
while (rs.next()) {
ZhaoPinHui t;
t = new Zh();
t.i_m_id = rs.getInt("i_id");
t.c_m_name = rs.getString("c_name");
t.c_m_mname = rs.getString("c_mname");
list.add(t);
}
}
finally {
if (rs != null)
rs.close();
if (pst != null)
pst.close();
if (con != null)
con.close();
}
//我在调用的时候也关闭了啊......
我发现数据库连接会不断的增加,不会释放,直到100个后,就挂起了。
谁可以帮我解决一下啊!!!
private static ComboPooledDataSource condb;
static {
try {
condb = new ComboPooledDataSource();
condb.setDriverClass("oracle.jdbc.driver.OracleDriver";
condb.setJdbcUrl("jdbcracle:thin192.168.0.1:1521:db";
condb.setUser("db";
condb.setPassword("db";
condb.setAcquireIncrement(1);
condb.setMaxPoolSize(100);
condb.setMinPoolSize(2);
condb.setInitialPoolSize(2);
} catch (Exception ex) {ex.printStackTrace();}
}
//===================================================//调用类初始化:
public static Connection getConnection() throws Exception {
return condb.getConnection();
}
//----------------------下面是操作调用:---------------------------------
try {
con = DBCon.getConnection();
pst = con.prepareStatement("select * from manage order by id desc");
rs = pst.executeQuery();
while (rs.next()) {
ZhaoPinHui t;
t = new Zh();
t.i_m_id = rs.getInt("i_id");
t.c_m_name = rs.getString("c_name");
t.c_m_mname = rs.getString("c_mname");
list.add(t);
}
}
finally {
if (rs != null)
rs.close();
if (pst != null)
pst.close();
if (con != null)
con.close();
}
//我在调用的时候也关闭了啊......
我发现数据库连接会不断的增加,不会释放,直到100个后,就挂起了。
谁可以帮我解决一下啊!!!
楼主【xyflash】截止到2008-07-08 16:37:09的历史汇总数据(不包括此帖):
发帖的总数量:214 发帖的总分数:2345 每贴平均分数:10
回帖的总数量:285 得分贴总数量:68 回帖的得分率:23%
结贴的总数量:193 结贴的总分数:2040
无满意结贴数:72 无满意结贴分:1470
未结的帖子数:21 未结的总分数:305
结贴的百分比:90.19 % 结分的百分比:86.99 %
无满意结贴率:37.31 % 无满意结分率:72.06 %
值得尊敬
try {
condb = new ComboPooledDataSource();
condb.setDriverClass("oracle.jdbc.driver.OracleDriver";
condb.setJdbcUrl("jdbcracle:thin192.168.0.1:1521:db";
condb.setUser("db";
condb.setPassword("db";
condb.setAcquireIncrement(1);
condb.setMaxPoolSize(100);
condb.setMinPoolSize(2);
condb.setInitialPoolSize(2);
} catch (Exception ex) {ex.printStackTrace();
}
setMaxIdleTime(int)