2017-10-06 64 views
0

我在使用WLST获取weblogic服务器中数据源的JDBC驱动程序的某些属性时遇到问题。如何使用WLST获取数据源JDBC驱动程序属性

Altough我可以得到DS的许多特性是这样的:

allJDBCResources = cmo.getJDBCSystemResources() 
    for jdbcResource in allJDBCResources: 
      dsname = jdbcResource.getName() 
      dsResource = jdbcResource.getJDBCResource() 
      dsJNDIname = dsResource.getJDBCDataSourceParams().getJNDINames()[0] 
      dsInitialCap = dsResource.getJDBCResource().getJDBCConnectionPoolParams().getInitialCapacity() 

我仍然无法从这个检索值(图像更好地了解问题的):

enter image description here

我能够获得驱动程序类的名称,但不是该领域的propierties。我需要通过WLST来检索:

  • 用户
  • readtimeout
  • connect_timeout

我见过很多的,通过谷歌的网页,但只以“集”的属性不是一种方式来获得那个价值。

任何帮助表示赞赏。

+0

所以,你正试图获得用户名? – Ravi

+0

我想要获取属性中的所有值:user,readtimeout和connect_timeout –

回答

0

好吧,我实现了我需要这样的:

 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: 
        pass 

此后,我有我需要的信息,只需在一个可怕的字符串,但我会与Python解析它。

相关问题