~ / archivo / stackoverflow / 46609377
How to get Datasource JDBC Driver Properties with WLST
StackOverflow
· jdbc, weblogic, datasource, wlst
· pregunté
respuesta aceptada
-
I have a problem getting some properties of the JDBC Driver of a Datasource in a weblogic server using WLST.
Altough I can get many properties of the DS like this:
allJDBCResources = cmo.getJDBCSystemResources() for jdbcResource in allJDBCResources: dsname = jdbcResource.getName() dsResource = jdbcResource.getJDBCResource() dsJNDIname = dsResource.getJDBCDataSourceParams().getJNDINames()[0] dsInitialCap = dsResource.getJDBCResource().getJDBCConnectionPoolParams().getInitialCapacity()I'm still unable to retrieve the values from this (image for better understanding of the problem):
I'm able to get the driver class name but not the propierties in that field. I need to retrieve through WLST:
- user
- readtimeout
- connect_timeout
I've seen lots of pages through google but only to "set" the properties not a way to get that values.
Any help is appreciated.
- Ravi 2017-10-06 16:06 so, you are trying to get username ?
- Miguel Ortiz yo 2017-10-06 16:28 I'm trying to get all the values in Properties: user, readtimeout and connect_timeout
-
Well, I achieved what I needed in this way:
try : user = ls("/JDBCSystemResources/"+ dsname +"/Resource/" + dsname + "/JDBCDriverParams/" + dsname + "/Properties/" + dsname + "/Properties/user") readTimeOut = ls("/JDBCSystemResources/"+ dsname +"/Resource/" + dsname + "/JDBCDriverParams/" + dsname + "/Properties/" + dsname + "/Properties/oracle.jdbc.ReadTimeout") conTimeOut = ls("/JDBCSystemResources/"+ dsname +"/Resource/" + dsname + "/JDBCDriverParams/" + dsname + "/Properties/" + dsname + "/Properties/oracle.net.CONNECT_TIMEOUT") streamAsBlob = ls("/JDBCSystemResources/"+ dsname +"/Resource/" + dsname + "/JDBCDriverParams/" + dsname + "/Properties/" + dsname + "/Properties/SendStreamAsBlob") except WLSTException: passAnd after that I had the information I needed, just in an horrible string but I'll parse it with python.