Configure Data Sources
Specifying JDBC Providers and Data Sources
Overview
There are two ways to configure Database Providers for deployment.
The first is to use Database Libraries from within the framework server. A Database Library contains one or more Data Sources, and is stored on the framework server as an XML file. On deployment, this file is read by the jython framework and Data Sources and Database Providers are configured in the target cell.
The second method allows you to add Database Providers and Data Sources directly into the jython file using properties (name/value pairs).
This page considers the second case only.
Each set of name/value pairs is terminated with _n where n is an integer, incrementing from 1 and referencing the next Provider and DataSource to be created or modified.
Provider and Datasource creation policy
By default the RapidDeploy Jython framework will create both the JDBC provider and the datasource in one step, if you want to omit any of these sub-steps you can do so by using the following variables:
omitProviderCreation_1 = "true" omitDatasourceCreation_1 = "true"
Note that if you want to create only the datasource and omit the provider creation sub-step you still need to set the jdbcname_1 variable in order to indicate the provider used by the datasource to be created.
Oracle
Configuring an Oracle Database Provider and Data Sources.
#--------------------------------------------------- # JDBC Provider 1 and DataSource Related Variables #--------------------------------------------------- templateName_1 = "" databaseURL_1 = "jdbc:oracle:thin:@lonora03:1526:stdb10g1" dsj2eeAttr_1 = [[[ "name","connectionProperties"] , ["type","java.lang.String"] , [ "value","oracle.jdbc.V8Compatible=true"]]] jdbcimplclass_1 = "oracle.jdbc.xa.client.OracleXADataSource" jdbcdesc_1 = "Oracle 10g2" dsHelper_1 = "com.ibm.websphere.rsadapter.Oracle10gDataStoreHelper" jdbcscope_1 = "cell" jdbcname_1 = "PegaRULES" driverPath_1 = "${ORACLE_JDBC_DRIVER_PATH}/ojdbc14.jar" dsname_1 = "PegaRULES_SysTst00" dsjndiname_1 = "jdbc/"+dsname_1 cfname_1 = "PegaRULES_SysTst00" agedTimeout_1 = 1000 connectionTimeout_1 = 1000 maxConnections_1 = 50 minConnections_1 = 5 purgePolicy_1 = "EntirePool" reapTime_1 = 2000 unusedTimeout_1 = 3000 stmentCacheSize_1 = 10 #--------------------------------------------------------- #------ Connection validation properties ----------------- #------ Validate existing pooled connections ------------- #--------------------------------------------------------- dsPreTestConnection_1 = "false" dsRetryInterval_1 = 0
SQL Server
Configuring SQL Server Database Provider and Data Source
#--------------------------------------------------- # JDBC Provider 2 and DataSource Related Variables #--------------------------------------------------- templateName_2 = "" databaseURL_2 = "jdbc:sqlserver:s01wp09A.ho.lloydstsb.co.uk:1433:FTArchiving" dsj2eeAttr_2 = [[["name", "databaseName"], ["type", "java.lang.String"], ["value", "FTArchiving"]], [["name", "serverName"], ["type", "java.lang.String"], ["value", "s01wp09A.ho.lloydstsb.co.uk"]], [["name", "portNumber"], ["type", "java.lang.Integer"], ["value", "1433"]], [["name", "enable2Phase"], ["type", "java.lang.Boolean"], ["value", "false"]]] jdbcimplclass_2 = "com.ibm.websphere.jdbcx.sqlserver.SQLServerDataSource" jdbcdesc_2 = "MS SQL Server" dsHelper_2 = "com.ibm.websphere.rsadapter.WSConnectJDBCDataStoreHelper" jdbcscope_2 = "cell" jdbcname_2 = "FTArchiving" driverPath_2 = "${WAS_LIBS_DIR}/sqlserver.jar;${WAS_LIBS_DIR}/base.jar;${WAS_LIBS_DIR}/util.jar;${WAS_LIBS_DIR}/spy.jar" dsname_2 = "FTArchiving_SysTst00" dsjndiname_2 = "jdbc/"+dsname_2 cfname_2 = "FTArchiving_SysTst00" agedTimeout_2 = 1000 connectionTimeout_2 = 1000 maxConnections_2 = 50 minConnections_2 = 5 purgePolicy_2 = "EntirePool" reapTime_2 = 2000 unusedTimeout_2 = 3000 stmentCacheSize_2 = 500 #--------------------------------------------------------- #------ Connection validation properties ----------------- #------ Validate existing pooled connections ------------- #--------------------------------------------------------- dsPreTestConnection_1 = "false" dsRetryInterval_1 = 0
IBM DB2
Configuring an IBM DB2 Database Provider, Data Sources and authentication alias.
#--------------------------------------------------- # JDBC Provider 1 and DataSource Related Variables #--------------------------------------------------- templateName_1 = "" databaseURL_1 = "" dsj2eeAttr_1 = [[["name", "databaseName"], ["type", "java.lang.String"], ["value", "STPFAPD1"]], [["name", "driverType"], ["type", "java.lang.Integer"], ["value", 2]]] jdbcimplclass_1 = "com.ibm.db2.jcc.DB2XADataSource" jdbcdesc_1 = "XA DB2 JDBC Type 2 Driver" dsHelper_1 = "com.ibm.websphere.rsadapter.DB2UniversalDataStoreHelper" jdbcscope_1 = "cell" jdbcname_1 = "DB2 Universal JDBC Driver Provider (XA)" driverPath_1 = "/db2home/db3pfab1/sqllib/java/db2jcc.jar;/db2home/db3pfab1/sqllib/java/db2jcc_license_cu.jar;/db2home/db3pfab1/sqllib/java/db2jcc_license_cisuz.jar" dsname_1 = "STPFAPD1" dsjndiname_1 = "jdbc/stpdatasource" cfname_1 = "stpdatasource" agedTimeout_1 = 0 connectionTimeout_1 = 30 maxConnections_1 = 500 minConnections_1 = 1 purgePolicy_1 = "EntirePool" reapTime_1 = 180 unusedTimeout_1 = 1800 stmentCacheSize_1 = 10 #--------------------------------------------------------- #------ Connection validation properties ----------------- #------ Validate existing pooled connections ------------- #--------------------------------------------------------- dsPreTestConnection_1 = "false" dsRetryInterval_1 = 0 #--------------------------------------------------- # Database 1 JAAS Authentication Related Variables #--------------------------------------------------- databasePasswordAlias_1 = "wasliveManager/"+appName+"_1_DatabaseAuthInfo" databaseUserId_1 = "stp" databasePassword_1 = "STPFAPD1PWD" databaseDescription_1 = "STP Authentication Data for "+jdbcname_1 #--------------------------------------------------------- #------ Security settings -------------------------------- #--------------------------------------------------------- # These are the values by default, leave it blank ("") to set the value to "none". dsMappingConfigAlias_1 = "DefaultPrincipalMapping" dsMappingAuthDataAlias_1 = databasePasswordAlias_1
Data source properties
In order to create or modify data sources properties you need to declare the property with the prefix "dsProp_" and the suffix "_n", where n is the number of the data source being affected:
dsProp_propertyKey_1="propertyValue"
Advanced DB2 features
Here's an example of how to use the data source properties for the "Advanced DB2 features":
dsProp_optimizeDB2ForGetUseClose_1="true" dsProp_retryIntervalForClientReroute_1="30" dsProp_maxRetriesForClientReroute_1="5" dsProp_clientRerouteAlternateServerName_1="serverName" dsProp_clientRerouteAlternatePortNumber_1="2431" dsProp_clientRerouteServerListJNDIName_1="jndiName" dsProp_unbindClientRerouteListFromJndi_1="true"
Setting V8 Compatibility
dsj2eeAttr_1 = [[[ "name","connectionProperties"] , ["type","java.lang.String"] , [ "value","oracle.jdbc.V8Compatible=true"]]]
SQL Server example
dsj2eeAttr_2 = [[["name", "databaseName"], ["type", "java.lang.String"], ["value", "FTArchiving"]], [["name", "serverName"], ["type", "java.lang.String"], ["value", "s01wp09A.ho.midivision.co.uk"]], [["name", "portNumber"], ["type", "java.lang.Integer"], ["value", "1433"]], [["name", "enable2Phase"], ["type", "java.lang.Boolean"], ["value", "false"]]]
Pre-test Oracle connection with SQL pretest string
dsj2eeAttr_2 = [[["name", "preTestSQLString"], ["value", "SELECT COUNT(*) FROM pc_data_uniqueid"], ["type", "java.lang.String"], ["required", "false"]], [["name", "validateNewConnection"], ["value", "true"], ["type", "java.lang.Boolean"], ["required", "false"]], [["name", "validateNewConnectionRetryCount"], ["value", "100"], ["type", "java.lang.String"], ["required", "false"]], [["name", "validateNewConnectionRetryInterval"], ["value", "3"], ["type", "java.lang.String"], ["required", "false"]]]
Additional attributes settable as above
Specifies whether to activate re-authentication of connections. This option requires implementation of the doConnectionSetupPerTransaction method on the data store helper class for the JDBC provider that supports this data source.
[["name", "reauthentication]"], ["value", "true"], ["type", "java.lang.Boolean"], ["required", "false"]]