JDBC query scripts
The scripting library provides many script procedures to manage Java™ Database Connectivity (JDBC) configurations in the environment. This page provides usage information for scripts that retrieve configuration IDs for the JDBC configuration. We can run each script individually or combine many procedures to create custom automation scripts for the environment.
Each AdminJDBC script procedure is located in...
WAS_HOME/scriptLibraries/resources/JDBC/V70
The Jython script library provides script functions for J2C resources, JDBC providers, and JMS resources at the server scope. You can write the own custom scripts to configure resources at the cell, node, or cluster level.
Do not edit the script procedures in the script library. To write custom script library procedures, use the scripts in the WAS_HOME/scriptLibraries directory as Jython syntax samples. Save the custom scripts to a new subdirectory to avoid overwriting the library.
Use the following script procedures to query the JDBC configuration:
listDataSources
This script displays a list of configuration IDs for the data sources in the configuration. No input arguments are required for the script. However, we can specify a data source name to return a specific configuration id, as defined in the following table:
Table 1. listDataSources script
Argument Description dsName Optionally specifies the name of the data source of interest.
Syntax
AdminJDBC.listDataSources(dsName)Example usage
AdminJDBC.listDataSources()AdminJDBC.listDataSources("myDataSource")
listDataSourceTemplates
This script displays a list of configuration IDs for the data source templates in the environment. No input arguments are required for the script. However, we can specify a template name to return a specific configuration id, as defined in the following table:
Table 2. listDataSourceTemplates script
Argument Description templateName Optionally specifies the name of the template of interest.
Syntax
AdminJDBC.listDataSourceTemplates(templateName)Example usage
AdminJDBC.listDataSourceTemplates()AdminJDBC.listDataSourceTemplates("Derby JDBC Driver DataSource")
listJDBCProviders
This script displays a list of configuration IDs for the JDBC providers in the environment. No input arguments are required for the script. However, we can specify a JDBC provider name to return a specific configuration id, as defined in the following table:
Table 3. listJDBCProviders script
Argument Description jdbcName Optionally specifies the name of the JDBC provider of interest.
Syntax
AdminJDBC.listJDBCProviders(jdbcName)Example usage
AdminJDBC.listJDBCProviders()AdminJDBC.listJDBCProviders("myJDBCProvider")
listJDBCProviderTemplates
This script displays a list of configuration IDs for the JDBC provider templates in the environment. No input arguments are required for the script. However, we can specify a template name to return a specific configuration id, as defined in the following table:
Table 4. listJDBCProviderTemplates script
Argument Description templateName Optionally specifies the name of the template of interest.
Syntax
AdminJDBC.listJDBCProviderTemplates(templateName)Example usage
AdminJDBC.listJDBCProviderTemplates()AdminJDBC.listJDBCProviderTemplates("Derby JDBC Provider")
Related tasks
Use the script library to automate the application serving environment
Automating data access resource configuration using the scripting library
Related
JDBC configuration scripts
JMS query scripts
JMS configuration scripts
J2C configuration scripts
J2C query scripts