Oracle连接报错之IO异常(The Network Adapter could not establish the connection)
简单介绍:自己封装oracle jdbc的一些常用功能jar包,自己本机玩没啥问题,给别人玩儿,发现总是抛异常
IO异常(The Network Adapter could not establish the connection)
为什么呢?
首先 conn 不是全局的,最好声明为全局的,使用单例 比较好,然后进行业务操作的方法中都会去调用一个返回值是conn的方法getConnection(),
通常情况下,我们一般使用完数据库连接的时候,都会在finally中进行 conn pst(PrepareStatement) rs(ResultSet) 的资源关闭,问题就出在这里.
虽然我们关闭了conn,应该在conn.close()方法的下一行 使conn==null,更好一点。
Oracle连接报错之IO异常(The Network Adapter could not establish the connection)的更多相关文章
- 数据库连接报错之IO异常(The Network Adapter could not establish the connection)
Io 异常: The Network Adapter could not establish the connection 有以下四个原因: 1.oracle配置 listener.ora 和tnsn ...
- oracle:程序后台提示Io异常: The Network Adapter could not establish the connection)
今天要用tomcat部署一个系统,windows环境下,oracle和程序在一台机器上. 在配置jndi时,直接写成 jdbc:oracle:thin:@127.0.0.1:1521:orcl.启动程 ...
- Io 异常: The Network Adapter could not establish the connection
新接触一个项目,导入源码,在本地启动的时候后台报了一个错误: Could not discover the dialect to use. java.sql.SQLException: Io 异常: ...
- Io 异常: The Network Adapter could not establish the connection解决方案
Io 异常: The Network Adapter could not establish the connection解决方案 2016年06月04日 13:30:21 阅读数:46589 Io ...
- Io 异常: The Network Adapter could not establish the connection 解决方法
1.IP错误: 在设置URL时错误,例如:jdbc:oracle:thin:@192.168.1.80:1521:orcl 数据库服务器是否正确:ping 服务器IP是否通畅.ping不通则将URL更 ...
- [Oracle] Io Error: The Network Adapter could not establish the connection 解决方案
Io 异常: The Network Adapter could not establish the connection这个异常的出现一般与数据库和你的PC的设置有关 这种异常的出现大致上有下面几种 ...
- sqldeveloper建立新的连接是出现Status : Failure -Test failed: IO Error: The Network Adapter could not establish the connection
Status : Failure -Test failed: IO Error: The Network Adapter could not establish the connection解决办法: ...
- Oracle安装后遇到错误:The Network Adapter could not establish the connection
http://note.youdao.com/noteshare?id=e6baee7ea7b7f60d7a265124e2bdd46c&sub=988945C6DDE843D5A7D6588 ...
- IO 异常:The Network Adapter could not establish the connection 怎么解决
IO 异常:The Network Adapter could not establish the connection 怎么解决
随机推荐
- MysqlException: max pool size was reached.
2019-09-09 08:22:08.620 +00:00 [ERR] Connection id "0HLPKVK52H2OU", Request id "0HLPK ...
- python数据结构(一)
collections --容器数据类型,collections模块包含了除内置类型list,dict和tuple以外的其他容器数据类型. Counter 作为一个容器可以追踪相同的值增加了多少次 # ...
- 利用Chrome浏览器调试线上代码
前言 之前调试前端bug都是在开发环境中做完并多次测试没有问题之后发布测试环境,验收合格之后发布生产.但生产环境偏偏会有和开发和测试环境不一致的情况,例如测试环境需要加密,而开发环境先不加密,测试环境 ...
- Synchronized锁的是什么?
Synchronized锁的是什么? 临界区与锁 并发编程中不可避免的会出现多个线程共享同一个资源的情况,为了防止出现数据不一致情况的发生,人们引入了临界区的概念.临界区是一个用来访问共享资源的代码块 ...
- embedded database (H2, HSQL or Derby), please put it on the classpath
Description: Failed to configure a DataSource: 'url' attribute is not specified and no embedded data ...
- Numerical Sequence (Hard vision) 题解
The only difference between the easy and the hard versions is the maximum value of \(k\). You are gi ...
- BZOJ3573 米特运输 题解
题目 米特是D星球上一种非常神秘的物质,蕴含着巨大的能量.在以米特为主要能源的D星上,这种米特能源的运输和储存一直是一个大问题.D星上有N个城市,我们将其顺序编号为1到N,1号城市为首都.这N个城市由 ...
- 从零开始学Electron笔记(二)
在之前的文章我们简单介绍了一下Electron可以用WEB语言开发桌面级应用,接下来我们继续说一下Electron的菜单创建和事件绑定. 我们接上一章的代码继续编写,上一章代码 https://www ...
- Redis批量查询模板
场景 在开发的时候经常会遇到批量取缓存的问题,例如查询商品信息 传入一个商品Id列表,查询Redis数据存在则放入返回列表 不存在的数据查找数据库,并放入Redis 上面两步数据整合返回 伪代码为 l ...
- 一篇文章掌握 Python 内置 zip() 的全部内容
一篇文章掌握 Python 内置 zip() 的全部内容 zip() 是 Python 中最好用的内置类型之一,它可以接收多个可迭代对象参数,再返回一个迭代器,可以把不同可迭代对象的元素组合起来. 我 ...