社区
Web 开发
帖子详情
oracle的java.sql.SQLException: Io 异常 The Network Adapter could not establish the connection
Northgale
2009-05-23 11:32:42
不知道怎么用java获得oracle的java.sql.SQLException: Io 异常 The Network Adapter could not establish the connection
我就是要catch这个异常,知道当前数据库的状态
...全文
299
8
打赏
收藏
oracle的java.sql.SQLException: Io 异常 The Network Adapter could not establish the connection
不知道怎么用java获得oracle的java.sql.SQLException: Io 异常 The Network Adapter could not establish the connection 我就是要catch这个异常,知道当前数据库的状态
复制链接
扫一扫
分享
转发到动态
举报
写回复
配置赞助广告
用AI写文章
8 条
回复
切换为时间正序
请发表友善的回复…
发表回复
打赏红包
qiheia
2009-05-26
打赏
举报
回复
捕获这个异常,try-catch一下就可以了啊。。。。。。
livingboy
2009-05-25
打赏
举报
回复
继承下来这个异常,自己写
cjdxhc
2009-05-25
打赏
举报
回复
catch(SQLException e){
e.getMessage();
}
Northgale
2009-05-25
打赏
举报
回复
这个异常可以用getErrorCode()抓orcle的错误码,错误信息可由getMessage()得到
livingboy 说的对,自己写,继承这个异常,可能是一大堆的case
我觉得脑子比较艮,程序做的好的化,这些异常因该给个良好的提示
happydaisy1985
2009-05-25
打赏
举报
回复
顶一下吧!
Northgale
2009-05-25
打赏
举报
回复
我知道,我就是故意要让他甩这个异常,在程序中检测,数据库的状态
你用oracle的NetManager连接数据库时它会提示各种数据连接信息比如:无法监听、或者服务名不正确之类的提示
我的目的就是在我自己的程序中得到这些提示。
jumpheightway
2009-05-25
打赏
举报
回复
数据库
监听器开启没有
说你没有可用网络连接
qiheia
2009-05-23
打赏
举报
回复
你好像数据库的服务都没开启把。。。。
java
.
sql
.
SQL
Except
io
n
:
Io
异常
: The
Network
Adapter
could not
es
tabl
ish
the
connect
io
n
java
.
sql
.
SQL
Except
io
n
:
Io
异常
: The
Network
Adapter
could not
es
tabl
ish
the
connect
io
n
at
oracle
.jdbc.driver.DatabaseError.throw
Sql
Except
io
n
(DatabaseError.
java
:112) at
oracle
.jdbc.driver.DatabaseError.t...
java
.
sql
.
SQL
Except
io
n
:
Io
异常
: The
Network
Adapter
could not
es
tabl
ish
the
connect
io
n
解决方法
一。
异常
报错
java
.
sql
.
SQL
Except
io
n
:
Io
异常
: The
Network
Adapter
could not
es
tabl
ish
the
connect
io
n
at
oracle
.jdbc.driver.DatabaseError.throw
Sql
Except
io
n
(DatabaseError.
java
:111) at
oracle
.jdbc.driver.DatabaseError.throw
Sql
Except
io
n
(DatabaseError.j...
Caused by:
java
.
sql
.
SQL
Except
io
n
:
Io
异常
: The
Network
Adapter
could not
es
tabl
ish
the
connect
io
n
Caused by:
java
.
sql
.
SQL
Except
io
n
:
Io
异常
: The
Network
Adapter
could not
es
tabl
ish
the
connect
io
n
java
.
sql
.
SQL
Except
io
n
:
Io
异常
:The
Network
Adapter
could not
es
tabl
ish
the connect
java
.
sql
.
SQL
Except
io
n
:
Io
异常
:The
Network
Adapter
could not
es
tabl
ish
the connect 运行
java
代码测试连接
oracle
数据库时报如下错误:
java
.
sql
.
SQL
Except
io
n
:
Io
异常
: The
Network
Adapter
could not
es
tabl
ish
the
connect
io
n
java
.
sql
.
SQL
Except
io
n
:
Io
异常
: The
Network
Adapter
could not
es
tabl
ish
the
connect
io
n
解决方案
java
.
sql
.
SQL
Except
io
n
:
Io
异常
: The
Network
Adapter
could not
es
tabl
ish
the
connect
io
n
是我今天刚遇到的问题,有很多原因导致这个,网上也有答案,我的主要毛病是在hibernate.properti
es
文件中没有把hibernate.properti
es
中的行:hibernate.
connect
io
n
.url
Web 开发
81,092
社区成员
341,716
社区内容
发帖
与我相关
我的任务
Web 开发
Java Web 开发
复制链接
扫一扫
分享
社区描述
Java Web 开发
社区管理员
加入社区
获取链接或二维码
近7日
近30日
至今
加载中
查看更多榜单
社区公告
暂无公告
试试用AI创作助手写篇文章吧
+ 用AI写文章