我正在尝试使用脚本在单元范围内创建 JDBC 提供程序。我在 IBM 文档中找到了创建 JDBCProvider 的方法,但它在 Node 范围内创建了提供程序:
providerName = 'DB2 Universal JDBC Driver Provider'
providerAttribs = [["xa", "false"], ["providerType", providerName], ['isolatedClassLoader', 'false'],
['nativepath', '${DB2UNIVERSAL_JDBC_DRIVER_NATIVEPATH}'],
['classpath', '${DB2UNIVERSAL_JDBC_DRIVER_PATH}/db2jcc.jar;${DB2UNIVERSAL_JDBC_DRIVER_PATH}/db2jcc_license_cisuz.jar']]
provider = AdminJDBC.createJDBCProvider(nodeName, serverName, providerName, 'com.ibm.db2.jcc.DB2ConnectionPoolDataSource', providerAttribs)
我已阅读以下 API createJDBCProviderAtScope
:http ://pic.dhe.ibm.com/infocenter/wasinfo/v8r0/index.jsp?topic=%2Fcom.ibm.websphere.express.doc%2Finfo%2Fexp%2Fae%2Frxml_7adminjdbc .html并且我已经更新了我的代码:
providerAttribs = [["xa", "false"], ["providerType", providerName], ['isolatedClassLoader', 'false'],
['nativepath', '${DB2UNIVERSAL_JDBC_DRIVER_NATIVEPATH}'],
['implementationClassName', 'com.ibm.db2.jcc.DB2ConnectionPoolDataSource'],
['classpath', '${DB2UNIVERSAL_JDBC_DRIVER_PATH}/db2jcc.jar;${DB2UNIVERSAL_JDBC_DRIVER_PATH}/db2jcc_license_cisuz.jar']]
provider = AdminJDBC.createJDBCProviderAtScope(cell, "DB2", providerName, providerName, 'Connection pool data source', providerAttribs)
但现在我得到了例外:
异常:com.ibm.ws.scripting.ScriptingException com.ibm.ws.scripting.ScriptingException:com.ibm.ws.scripting.ScriptingException:com.ibm.websphere.management.cmdframework.CommandNotFoundException:ADMF0006E:命令 createJDBCProvider 的步骤 xa没有找到。
在单元范围内创建 JDBCProvider 的正确方法是什么?