首页 新闻 会员 周边 捐助

在Eclipse中用spring搭jdbc会报下面的错误,是什么原因啊?

0
悬赏园豆:5 [待解决问题]

Exception in thread "main" org.springframework.jdbc.CannotGetJdbcConnectionException: Could not get JDBC Connection; nested exception is org.apache.commons.dbcp.SQLNestedException: Cannot create PoolableConnectionFactory (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

Eden-programmer的主页 Eden-programmer | 初学一级 | 园豆:194
提问于:2016-02-06 13:12
< >
分享
所有回答(2)
0

oracle服务的问题,SID 没填写对吧

http://www.cnblogs.com/2018/archive/2012/05/01/2443307.html

2012 | 园豆:21645 (高人七级) | 2016-02-06 14:14

我用的plsql,授权给dev,密码也是dev,我查看了SID是orcl

<bean id="dbcp"
 class="org.apache.commons.dbcp.BasicDataSource">
 <property name="username" value="dev">
 </property>
 <property name="password" value="dev">
 </property>
 <property name="driverClassName"
  value="oracle.jdbc.OracleDriver">
 </property>
 <property name="url"
  value="jdbc:oracle:thin:@localhost:1521:orcl">
 </property>
</bean>

支持(0) 反对(0) Eden-programmer | 园豆:194 (初学一级) | 2016-02-06 15:02
0

jdbc.driver=oracle.jdbc.driver.OracleDriver 改成这个试下

峰和日丽 | 园豆:110 (初学一级) | 2016-02-16 10:36
清除回答草稿
   您需要登录以后才能回答,未注册用户请先注册