Saturday, July 5, 2014

change connectionpool URL with WLST

###################****##############****########################  
# Generic script applicable on any Operating Environments (Unix, Windows)  
# ScriptName    : ChangeConnectionPoolURL.py  
# Author        : Madhusudhana Chilipi  
###############     Connecting to Start     #################################  

connect('weblogic','welcome1','t3://localhost:7001')
cd('Servers/AdminServer')
edit()
startEdit()
cd('JDBCSystemResources')
allDS=cmo.getJDBCSystemResources()

###############     Changing the Datasources     #################################  

for tmpDS in allDS:
    dsName=tmpDS.getName();
    print  '************* Changing URL for DataSource ', dsName      
    cd('/JDBCSystemResources/'+dsName+'/JDBCResource/'+dsName+'/JDBCDriverParams/'+dsName+'')
    set('Url','jdbc:oracle:thin:@localhost:1521:xe')
    print("************* URL has been Changed for DataSource: ", dsName)
    print ('')
    print ('')
save()
activate()

###############     End    #################################

No comments:

Post a Comment