Topic
IC4NOTICE: developerWorks Community will be offline May 29-30, 2015 while we upgrade to the latest version of IBM Connections. For more information, read our upgrade FAQ.
No replies
ColinFreas
ColinFreas
6 Posts
ACCEPTED ANSWER

Pinned topic scripting datasource w/cmp?

‏2011-08-03T21:30:45Z |
I have a script executing these commands:
----
provider = AdminTask.createJDBCProvider('[-scope Cell=unknownCell01 -databaseType Oracle -providerType "Oracle JDBC Driver" -implementationType "Connection pool data source" -name "test2" -description "" -classpath [/opt/IBM/WebSphere/AppServer/lib/ojdbc6.jar ] -nativePath "" ]')

ds = AdminTask.createDatasource(provider, '[-name test2 -jndiName test2 -dataStoreHelperClassName com.ibm.websphere.rsadapter.Oracle10gDataStoreHelper -containerManagedPersistence true -componentManagedAuthenticationAlias unknownCell01manager/OracDBUser -configureResourceProperties [URL java.lang.String jdbc:oracle:thin:@snake:1521:orcl]]')

AdminConfig.save()
----

There's a problem though. The JDBC provider and the datasource are created. But the datasource, despite the "-componentManangedAuthenticationAlias" option I include in the createDatasource command, does not have the "OracDBUser" set as the authentication alias.

The alias exists. I can set it through the admin console, and than logs some "MappingModule" commands I'm not familiar with, like these:
----
  1. 8/3/11 13:08:46:650 EDT JDBC providers > test2 > Data sources > test2
AdminConfig.modify('(cells/unknownCell01|resources.xml#CMPConnectorFactory_1312391286850)', '[ ')

  1. 8/3/11 13:08:46:652 EDT JDBC providers > test2 > Data sources > test2
AdminConfig.create('MappingModule', '(cells/unknownCell01|resources.xml#CMPConnectorFactory_1312391286850)', '[ ')

  1. 8/3/11 13:08:46:658 EDT JDBC providers > test2 > Data sources > test2
AdminConfig.modify('(cells/unknownCell01|resources.xml#DataSource_1312391286842)', '[ ')

  1. 8/3/11 13:08:46:659 EDT JDBC providers > test2 > Data sources > test2
AdminConfig.create('MappingModule', '(cells/unknownCell01|resources.xml#DataSource_1312391286842)', '[ ')

  1. 8/3/11 13:08:46:664 EDT JDBC providers > test2 > Data sources > test2
AdminConfig.modify('(cells/unknownCell01|resources.xml#J2EEResourceProperty_1312391286857)', '[ ')
----

Is there a trick to this?

TIA.

-Colin