取得Easerver中的Connection Cache清單

本文介绍了一种使用PB+Easerver动态获取所有ConnectionCache的方法。通过利用Jaguar/Repository接口,作者实现了对连接缓存的遍历,并筛选出了特定类型的连接信息。

最近在使用PB+Easerver做些開發,需要程式動態取得所有的Connection Cache,幾經周轉未果,今翻書偶得一代碼,雖不是順手
拿來可用,但其中思想正是所求,稍作修改后一試,果不其然......
現在此作個記錄,以便日后查詢.

//此功能需要使用到Jaguar/Repository接口.
repository px_repos
properties px_cacheprops
view px_cacheview
string ls_cache='',ls_return=''
integer i,j
integer li_numcaches=0

repositoryexception lex_error
lex_error = create repositoryexception
its.CreateInstance(px_repos,"Jaguar/Repository")
try
px_cacheview = px_repos.items("ConnCache","")
for i=UpperBound(px_cacheview.item) to 1 step -1
ls_cache = px_cacheview.item[i].item[2]
px_cacheprops = px_repos.lookup("ConnCache",ls_cache)
for j = Upperbound(px_cacheprops.item) to 1 step -1
IF px_cacheprops.item[j].name =
"com.sybase.jaguar.conncache.conlibname" then
if mid(upper(px_cacheprops.item[j].value),1,3)='OCI' THEN
ls_return = ls_return+'~r~n'+upper(ls_cache)+'~tN'
end if
exit
end if
end for
next
return mid(ls_return,3)
Catch(lookuperror le)
// lex_error.reason = le.reason
throw lex_error
catch (throwable t)
// lex_error.reason=t.getmessage()
throw lex_error
end try

 

评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值