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
oracle服务的问题,SID 没填写对吧
http://www.cnblogs.com/2018/archive/2012/05/01/2443307.html
我用的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>
jdbc.driver=oracle.jdbc.driver.OracleDriver 改成这个试下