GeeCON Prague 2014*
The moose likes Websphere and the fly likes Need help in fetching connectionTimeout value for datasources, using jython scripting Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Products » Websphere
Bookmark "Need help in fetching connectionTimeout value for datasources, using jython scripting" Watch "Need help in fetching connectionTimeout value for datasources, using jython scripting" New topic
Author

Need help in fetching connectionTimeout value for datasources, using jython scripting

Avijit Pal
Greenhorn

Joined: Jul 05, 2014
Posts: 1
#-------------------------------------------------------------------------------
import sys
global AdminConfig
global AdminControl
lineSeparator = java.lang.System.getProperty('line.separator')

#-------------------------------------------------------------------------------
# updateDataSource(scope,params)
# update connection timeout value for all datasources
#-------------------------------------------------------------------------------

def updateDataSource(scope,params):
dataSources = AdminConfig.list('DataSource', AdminConfig.getid(scope))
if len(dataSources) > 0:
dsList = dataSources.split(lineSeparator)
for ds in dsList:
dsName = AdminConfig.showAttribute(ds, "name")
if dsName != "DefaultEJBTimerDataSource":
print AdminConfig.showall(ds) ####### It shows everything, but I only need connectionTimeout value
AdminConfig.modify(ds, params)
print " Modified datasource: " + dsName

#endDef
#-----------------------------------------------------------------




OUTPUT for AdminConfig.showall():

[authMechanismPreference BASIC_PASSWORD]
[category default]
[connectionPool [[agedTimeout []]
[connectionTimeout 1000]
[maxConnections 30]
[minConnections 1]
[purgePolicy FailingConnectionOnly]
[reapTime 180]
[unusedTimeout 1800]]]
...........................
....................
.............
.......
..




Hi friends,

I have developed the above script to modify connectionTimeout value for all datasources in a specified scope. Before modifying the values I want the script to fetch and show current values for backout purpose, but facing issues in fetching connectionTimeout value. AdminConfig.showall() can fetch everything but I want only value for connectionTimeout which is 1000 here. Can anyone give me a quick solution as this is very urgent for me. Thanks in advance.
 
GeeCON Prague 2014
 
subject: Need help in fetching connectionTimeout value for datasources, using jython scripting