您的位置:首页 > 数据库

Mybatis连接数据库时报错原因归纳

2017-04-20 23:18 162 查看
一:

报错信息

org.apache.ibatis.exceptions.PersistenceException: 

### Error querying database.  Cause: 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:oracl

### The error may exist in sqlMapper/UsersMapper.xml

### The error may involve test.findUserById

### The error occurred while executing a query

### Cause: 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:oracl

这里报错的可能性在于配置文件中的jdbc.url=jdbc:oracle:thin:@localhost:1521:oracl的oracl不是Oracle数据库的SID,数据库的SID是orcl,所以会报这个错,可以通过服务查看Oracle的SID进行核对 
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: