DataSourceCfgHelper MBean

Partial ObjectName:
WebSphere:*,type=DataSourceCfgHelper


MBean DataSourceCfgHelper

Management interface for helper class that performs several admin functions for the JDBC DataSource.


Operation Summary
java.util.ListgetPropertiesForDataSource(java.lang.String dsClassName, java.lang.String providerLibPath)
           Creates a list of all settable properties available for a DataSource.
voidreload()
           Reloads resources.
java.lang.StringtestConnectionToDataSource(java.lang.String dsClassName, java.lang.String user, java.lang.String password, java.util.Properties dataSourceProps, java.lang.String providerLibPath, java.lang.String language, java.lang.String country)
           Tests getting a connection to the specified DataSource and returns a message suitable for display to the user containing any warnings and errors.
inttestConnection(java.lang.String resURI)
           Tests getting a connection to the specified resource and returns a 0 for success, 1 for warnings and throws exceptions for failures.
java.lang.StringtestConnectionToDataSource(java.lang.String dsClassName, java.lang.String user, java.lang.String password, java.util.Properties dataSourceProps, java.lang.String providerLibPath, java.util.Locale locale)
           Tests getting a connection to the specified DataSource and returns a message suitable for display to the user containing any warnings and errors.

Operation Detail

getPropertiesForDataSource

public java.util.List getPropertiesForDataSource(java.lang.String dsClassName, java.lang.String providerLibPath)
Creates a list of all settable properties available for a DataSource. The list is an ArrayList of DSPropertyEntry -- consisting of (propertyName, propertyType, isRequired, defaultValue). Required properties are listed first, and no duplicates may appear in the list. The list also contains properties required by the WebSphere DataSource implementation (informixLockWaitMode, enable2Phase).
Parameters:
dsClassName - the class name of the JDBC provider data source class to retrieve the properties for
providerLibPath - the path to the folder containing the needed JDBC provider classes
Security Roles:
administrator
operator
configurator
monitor
deployer
adminsecuritymanager

reload

public void reload()
Reloads resources.xml. This function may be called to bind a new data source after server start. It does not impact existing data sources.
Security Roles:
administrator
operator

testConnectionToDataSource

public java.lang.String testConnectionToDataSource(java.lang.String dsClassName, java.lang.String user, java.lang.String password, java.util.Properties dataSourceProps, java.lang.String providerLibPath, java.lang.String language, java.lang.String country)
Tests getting a connection to the specified DataSource and returns a message suitable for display to the user containing any warnings and errors. Loads the specified data source class, sets the data source properties as specified, and attempts to open a connection. If all of this works as planned, we return a null message, indicating success. If everything works with the exception that some properties are not found or are invalid, we return a message like this: 'Successfully connected to data source, with N warnings.' where N is the number of warnings. The message also contains a description of each warning. If we can't open a connection, we return a message with the exception that states failure. If it's a SQLException we also include the Error Code and SQL State. This method also tests whether the DataStoreHelper class specified in the DataSource properties exists and implements the DataStoreHelper interface. If it does not, a warning explaining the problem is added to the message.
Parameters:
dsClassName - the class name of the JDBC provider data source class to retrieve the properties for
user - user name for connecting to the database.
password - password for connecting to the database.
dataSourceProps - list of the properties you wish to set when testing the data source
providerLibPath - the path to the folder containing the needed JDBC provider classes
language - the langauge of the locale to use for any warnings returned by the test connection
country - the country of the locale to use for any warnings returned by the test connection
Security Roles:
administrator
operator
configurator
monitor
deployer
adminsecuritymanager

testConnection

public int testConnection(java.lang.String resURI)
Tests getting a connection to the specified resource and returns a 0 for success, 1 for warnings and throws exceptions for failures. Exception messages with details are logged in the server logs.
Parameters:
resURI - The resource URI. This will be use to retrieve the resource properties from WCCM.
ResourceInstanceIdentifier
The resource being modified for the MBean is of type ResourceURI
The instance is identified by the value of the parameter
Security Roles:
administrator
operator
configurator
monitor
deployer
adminsecuritymanager

testConnectionToDataSource

public java.lang.String testConnectionToDataSource(java.lang.String dsClassName, java.lang.String user, java.lang.String password, java.util.Properties dataSourceProps, java.lang.String providerLibPath, java.util.Locale locale)
Tests getting a connection to the specified DataSource and returns a message suitable for display to the user containing any warnings and errors. Loads the specified data source class, sets the data source properties as specified, and attempts to open a connection. If all of this works as planned, we return a null message, indicating success. If everything works with the exception that some properties are not found or are invalid, we return a message like this: 'Successfully connected to data source, with N warnings.' where N is the number of warnings. The message also contains a description of each warning. If we can't open a connection, we return a message with the exception that states failure. If it's a SQLException we also include the Error Code and SQL State. This method also tests whether the DataStoreHelper class specified in the DataSource properties exists and implements the DataStoreHelper interface. If it does not, a warning explaining the problem is added to the message. This method is being added only because it is described in the documentation.
Parameters:
dsClassName - the class name of the JDBC provider data source class to retrieve the properties for
user - user name for connecting to the database.
password - password for connecting to the database.
dataSourceProps - list of the properties you wish to set when testing the data source
providerLibPath - the path to the folder containing the needed JDBC provider classes
locale - the locale to use for any warnings returned by the test connection
Security Roles:
administrator
operator
configurator
monitor
deployer
adminsecuritymanager

Copyright IBM Corp. 1996-2005