||||
今天一下午弄了下从文件导入数据库,期间遇到两个问题.再小的事中也能学到一些东西。现在写一下,方便有人遇到类似的问题。
问题一:一直不能获得connection
奇怪的地方是,以前的程序都能连上,这次写的就是不行,找了很久,最后发现该项目没有导入驱动,囧了~。
问题二:
Listener refused the connection with the follow
ing error:
ORA-12519, TNS:no appropriate service handler found
The Connection descriptor used by the client was:
192.168.1.6:1521
有人说要修改最大连接数,其实是治标不治本。最后发现问题的关键是忘记close一些连接
public void close() {
try {
if(rs!=null) rs.close();
if(ps!=null) ps.close();
if(ct!=null) ct.close();
} catch (Exception e) {
// TODO: handle exception
e.printStackTrace();
}
}
Archiver|手机版|科学网 ( 京ICP备07017567号-12 )
GMT+8, 2024-6-2 21:57
Powered by ScienceNet.cn
Copyright © 2007- 中国科学报社