使用 wsadmin 脚本编制来配置新的 WAS40 连接池(不推荐)
可以使用脚本编制来配置新的 WAS40 连接池。
开始之前
开始本任务前,wsadmin 工具必须正在运行。有关更多信息,请参阅“启动 wsadmin 工具”主题。
关于此任务
执行以下步骤配置新的 WAS40 连接池:
过程
- 确定父标识:
使用 Jacl:
set new40ds [$AdminConfig getid /Cell:mycell/Node:mynode/ Server:server1/JDBCProvider:JDBC1/WAS40DataSource:was4DS1/]- 使用 Jython:
new40ds = AdminConfig.getid('/Cell:mycell/Node:mynode/ Server:server1/JDBCProvider:JDBC1/WAS40DataSource:was4DS1/') print new40ds
示例输出:was4DS1(cells/mycell/nodes/mynodes:resources.xml$WAS40DataSource_1) - 获取必需的属性:
使用 Jacl:
$AdminConfig required WAS40ConnectionPool- 使用 Jython:
print AdminConfig.required('WAS40ConnectionPool')
示例输出:Attribute Type minimumPoolSize Integer maximumPoolSize Integer connectionTimeout Integer idleTimeout Integer orphanTimeout Integer statementCacheSize Integer - 设置必需的属性:
使用 Jacl:
set mps [list minimumPoolSize 5] set minps [list minimumPoolSize 5] set maxps [list maximumPoolSize 30] set conn [list connectionTimeout 10] set idle [list idleTimeout 5] set orphan [list orphanTimeout 5] set scs [list statementCacheSize 5] set 40cpAttrs [list $minps $maxps $conn $idle $orphan $scs]示例输出:{minimumPoolSize 5} {maximumPoolSize 30} {connectionTimeout 10} {idleTimeout 5} {orphanTimeout 5} {statementCacheSize 5}- 使用 Jython:
minps = ['minimumPoolSize', 5] maxps = ['maximumPoolSize', 30] conn = ['connectionTimeout', 10] idle = ['idleTimeout', 5] orphan = ['orphanTimeout', 5] scs = ['statementCacheSize', 5] cpAttrs = [minps, maxps, conn, idle, orphan, scs] print cpAttrs示例输出:[[minimumPoolSize, 5], [maximumPoolSize, 30], [connectionTimeout, 10], [idleTimeout, 5], [orphanTimeout, 5], [statementCacheSize, 5]]
- 创建 was40 连接池:
使用 Jacl:
$AdminConfig create WAS40ConnectionPool $new40ds $40cpAttrs- 使用 Jython:
print AdminConfig.create('WAS40ConnectionPool', new40ds, 40cpAttrs)
示例输出:(cells/mycell/nodes/mynode:resources.xml#WAS40ConnectionPool_1) - 保存配置更改。
任务主题
最近一次更新时间: last_datehttp://www14.software.ibm.com/webapp/wsbroker/redirect?version=cord&product=was-base-dist&topic=txml_newwas
文件名:txml_newwas.html