I'm trying to create JDBC provider at cell scope with scripting. I've found in the IBM documentation the way to create the JDBCProvider, but it creates provider at the Node scope:
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)
I've read the API for createJDBCProviderAtScope
: http://pic.dhe.ibm.com/infocenter/wasinfo/v8r0/index.jsp?topic=%2Fcom.ibm.websphere.express.doc%2Finfo%2Fexp%2Fae%2Frxml_7adminjdbc.html and I've updated my code:
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)
But now I get the exception:
Exception: com.ibm.ws.scripting.ScriptingException com.ibm.ws.scripting.ScriptingException: com.ibm.ws.scripting.ScriptingException: com.ibm.websphere.management.cmdframework.CommandNotFoundException: ADMF0006E: Step xa of command createJDBCProvider is not found.
What is the correct way to create JDBCProvider on the cell scope?