pb 全局 判断 数据库 是否连接成功

dzyjl 2013-04-22 10:01:58
我现在有好多窗口里面有select 语句 using sqlca,当数据库处于不可用状态时候,怎么去做全局判断?不可能每个select都去判断一下。
...全文
630 5 打赏 收藏 转发到动态 举报
AI 作业
写回复
用AI写文章
5 条回复
切换为时间正序
请发表友善的回复…
发表回复
pb8 2013-04-22
  • 打赏
  • 举报
回复
pb11.5以后可以, 继承transaction,在DBError事件里面写上连接判断与恢复的语句, 再将SQLCA的父类设置为你定义的新类 Argument Description code Long by value. A database-specific error code. See your DBMS documentation for information on the meaning of the code.When there is no error code from the DBMS, code contains one of these values:-1 - Cannot connect to the database-2 - Writing a blob to the database failed-4 - All other errors (see Usage note for more detail) sqlerrortext String by value. A database-specific error message. sqlsyntax String by value. The full text of the SQL statement being sent to the DBMS when the error occurred.
A啦Dbit 2013-04-22
  • 打赏
  • 举报
回复
transactionobject.DBHandle ( )>0
wag_enu 2013-04-22
  • 打赏
  • 举报
回复
这个没有啥好办法。 只是可以从改善网络状况,搭建VPN 等,使系统更稳定,事务连接更可靠而已。
sbks 2013-04-22
  • 打赏
  • 举报
回复
出错就提示检查网络就行了,提醒操作员让网管去查一下网络 对CS程序,不用费心思去判断数据连接,不然就失去CS的优势了:数据库直连
lao_bulls 2013-04-22
  • 打赏
  • 举报
回复
不知道楼上说的是否是真的。学习一下。

1,108

社区成员

发帖
与我相关
我的任务
社区描述
PowerBuilder 相关问题讨论
社区管理员
  • 基础类社区
  • WorldMobile
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧