2017-10-06 103 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解析它。

相關問題