***Creating new Datasource using wsadmin tool***
------------------------------------------------
There are two ways to configure datasource through wsadmin
1. AdminConfig object
2. AdminTask object
AdminConfig gives you more configuration control than the AdminTask object.
Using the AdminConfig object to configure a new data source:
------------------------------------------------------------
1. Identify the parent ID, which is the name and location of the JDBC provider that supports your data source
newjdbc = AdminConfig.getid('/Cell:TIT-JAVA-010Cell/Node:TIT-JAVA-010Node/Server:WebSphere_Portal/JDBCProvider:CustomJDBC2/')
print newjdbc
2. Obtain the required attributes
print AdminConfig.required('DataSource')
3. Set up the required attributes
name = ['name', 'customDataSource']
dsAttrs = [name]
4. Create the data source
newds = AdminConfig.create('DataSource', newjdbc, dsAttrs)
print newds
5. Save changes
AdminConfig.save()
Using the AdminTask object to configure a new data source:
----------------------------------------------------------
1. AdminTask.createDatasource (['-interactive'])
2. provide requird fields and follow the procedure
3. save changes
***Configuring new data source custom properties using wsadmin***
-----------------------------------------------------------------
1. Identify the parent ID
newds = AdminConfig.getid('/Cell:TIT-JAVA-010Cell/Node:TIT-JAVA-010Node/Server:WebSphere_Portal/JDBCProvider:CustomJDBC2/DataSource:customDataSource/')
print newds
2. Get the J2EE resource property set
propSet = AdminConfig.showAttribute(newds, 'propertySet')
print propSet
3. Get required attribute
print AdminConfig.required('J2EEResourceProperty')
4. Set up attributes
name = ['name', 'RP4']
rpAttrs = [name]
5. Create a J2EE resource property
print AdminConfig.create('J2EEResourceProperty', propSet, rpAttrs)
6. Save changes
AdminConfig.save()
------------------------------------------------
There are two ways to configure datasource through wsadmin
1. AdminConfig object
2. AdminTask object
AdminConfig gives you more configuration control than the AdminTask object.
Using the AdminConfig object to configure a new data source:
------------------------------------------------------------
1. Identify the parent ID, which is the name and location of the JDBC provider that supports your data source
newjdbc = AdminConfig.getid('/Cell:TIT-JAVA-010Cell/Node:TIT-JAVA-010Node/Server:WebSphere_Portal/JDBCProvider:CustomJDBC2/')
print newjdbc
2. Obtain the required attributes
print AdminConfig.required('DataSource')
3. Set up the required attributes
name = ['name', 'customDataSource']
dsAttrs = [name]
4. Create the data source
newds = AdminConfig.create('DataSource', newjdbc, dsAttrs)
print newds
5. Save changes
AdminConfig.save()
Using the AdminTask object to configure a new data source:
----------------------------------------------------------
1. AdminTask.createDatasource (['-interactive'])
2. provide requird fields and follow the procedure
3. save changes
***Configuring new data source custom properties using wsadmin***
-----------------------------------------------------------------
1. Identify the parent ID
newds = AdminConfig.getid('/Cell:TIT-JAVA-010Cell/Node:TIT-JAVA-010Node/Server:WebSphere_Portal/JDBCProvider:CustomJDBC2/DataSource:customDataSource/')
print newds
2. Get the J2EE resource property set
propSet = AdminConfig.showAttribute(newds, 'propertySet')
print propSet
3. Get required attribute
print AdminConfig.required('J2EEResourceProperty')
4. Set up attributes
name = ['name', 'RP4']
rpAttrs = [name]
5. Create a J2EE resource property
print AdminConfig.create('J2EEResourceProperty', propSet, rpAttrs)
6. Save changes
AdminConfig.save()
No comments:
Post a Comment