Example: Finding available templates
Some configuration object types, for example, Server and other resource types, have templates that you can use when you create an object. If you create a JDBCProvider object using the create command, this object is built with the default template. If you know that you need a particular type of JDBCProvider object, you can use a template for that type.
Use the AdminConfig object listTemplates command to list available templates, for example:
Using Jacl:
$AdminConfig listTemplates JDBCProvider
Using Jython:
AdminConfig.listTemplates('JDBCProvider')
- There is a variation of this command that makes it easier to locate a particular template or set of templates. If you supply a string after the name of a type, you only get back a list of templates display names that contain the supplied string, for example:
Using Jacl:
$AdminConfig listTemplates JDBCProvider DB2
Using Jython:
AdminConfig.listTemplates('JDBCProvider', 'DB2')This command returns a list of templates with display names containing DB2.
- You can use the show command with any template like any other configuration object, to see the attributes of the template object, for example:
Using Jacl:
set jdbc [$AdminConfig listTemplates JDBCProvider DB2] set jdbc1 [lindex $jdbc 0] $AdminConfig show $jdbc1
Using Jython:
jdbc = AdminConfig.listTemplates('JDBCProvider', 'DB2') # get line separator import java lineSeparator = java.lang.System.getProperty('line.separator') arrayJdbc = jdbc.split(lineSeparator) jdbc1 = arrayJdbc[0] AdminConfig.show(jdbc1)