Home
Editing Jython script files
The Jython editor is the tool for editing Jython scripts. The Jython editor has many text editing features, such as content assist, syntax highlighting, unlimited undo or redo, and automatic tab indentation.
Type the code shown in Example | 2-1. It lists all defined JDBC providers in the WebSphere Application Server. During typing, you can use content assist by pressing Ctrl+Space. You can find the code in:
c:\7672code\Jython\listJDBCProviders.pyExample 22-1 List JDBC providers using a Jython script
def showJdbcProviders():providerEntries = AdminConfig.list("JDBCProvider")# split long line of entries into individual entries in listproviderEntryList = providerEntries.split(lf)# print contents of listfor provider in providerEntryList:print providerAdminConfig.reset()cell = AdminControl.getCell()node = AdminControl.getNode()lf = java.lang.System.getProperty("line.separator")slash = java.lang.System.getProperty("file.separator")print "System information: Cell=" + cellprint "System information: Node=" + nodeshowJdbcProviders()
![]()
ibm.com/redbooks