日期:2014-05-17  浏览次数:21007 次

菜鸟初始jdbc的问题
在用jdbc操作oracle的时候,为什么当我注册驱动后,获取连接的时候,它报出了如下的错误:
  Exception in thread "main" java.sql.SQLException: Listener refused the connection with the following error:
ORA-12505, TNS:listener does not currently know of SID given in connect descriptor
The Connection descriptor used by the client was:
localhost:1521:orcl
  通过阅读错误信息,我大概知道是因为本地ip被占用的原因,但是我也不太清楚是不是这个原因;
还有不知一般有啥程序会占用此端口哦;请各位解释下哦。

------解决方案--------------------
oracle中有内置的jdbc驱动,难道是你从java连接oracle数据库的jar架包有问题?