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.py

Example 22-1 List JDBC providers using a Jython script

def showJdbcProviders():
	providerEntries = AdminConfig.list("JDBCProvider")
	# split long line of entries into individual entries in list
	providerEntryList = providerEntries.split(lf)
	# print contents of list
	for provider in providerEntryList:
		print provider	
	
AdminConfig.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=" + cell
print "System information: Node=" + node
showJdbcProviders()

ibm.com/redbooks