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进行核对
报错信息
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进行核对
相关文章推荐
- 使用Mybatis3.3.0获得已关闭的数据库连接?原因?
- MyBatis连接数据库失败可能的原因
- 数据库连接出错。错误代码:-2147467259。错误原因:未指定的错误
- mybatis动态连接数据库
- mybatis 的数据库连接配置
- 使用 IP 地址连接SQL Server 数据库的速度慢的原因
- vs.net C# 连接数据库 出现错误 用户 '(null)' 登录失败。原因: 未与信任 SQL Server 连接相关联
- 失败原因 :数据库连接字符无效,请与管理员联系!
- navicat连接数据库慢,或者连接不上,其他远程连接MySQL正常,是什么原因?
- 应用程序连接 SQL2000 数据库失败的一种可能原因
- mssql2000 数据库 JDBC连接不上的原因
- 未能建立与数据库的连接。原因是:…
- 使用 IP 地址连接SQL Server 数据库的速度慢的原因
- Tomcat连接不上数据库原因之一
- 无法连接远程SQL Server 数据库的原因
- JSP连接数据库不成功的可能原因
- 安装卡巴斯基7后,asp.net服务器无法连接数据库原因
- (转)数据库连接失败的多种原因
- 数据库连接超时的原因及其解决方法
- 数据库连接失败的原因分析及解决办法