Creating JDBC Multi Data Source through WLST in weblogic server
This tutorial explains the approach to create JDBC Multi data source through WLST script in weblogicRefer the below URL for details on JDBC Multi data source.
https://www.albinsblog.com/2012/02/jdbc-multi-data-sources-in-weblogic.html
WLST Script
CreateMultiDataSource.py
adminURL='t3://localhost:7001'
adminUserName='weblogic'
adminPassword='weblogic1'
connect(adminUserName, adminPassword, adminURL)
edit()
startEdit()
jdbcSystemResource = create("MS1","JDBCSystemResource")
jdbcResource = jdbcSystemResource.getJDBCResource()
jdbcResource.setName("MS1")
dsParams = jdbcResource.getJDBCDataSourceParams()
jndiName='jdbc/MS1'
dsParams.setJNDINames([jndiName])
dsParams.setAlgorithmType('Failover')
dsParams.setDataSourceList('DS1,DS2')
dsParams.setFailoverRequestIfBusy(true)
jdbcSystemResource.addTarget(getMBean('Servers/AdminServer'))
print('MDS1 created successfully...')
save()
activate()
disconnect()
Script
https://github.com/techforum-repo/youttubedata/blob/master/scripts/wlst/CreateMultiDataSource.py
Before executing the script, change the configurations as required.
The individual data sources(DS1 & DS2) should be created before executing the script
Execute the script — <<Oracle_Home>>\oracle_common\common\bin\wlst.cmd CreateMultiDataSource.py
Now the JDBC Multi source is created with required configurations
No comments:
Post a Comment