
Setting the connection information
The following methods are used to set the connection information:
- setConnection(String strURL, String strUID, String strPSWD, String strJdbcDriver)
- setConnection(String strURL, String strUID, String strPSWD, String strJdbcDriver, boolean fetchSupportInfo)
- setConnection(String dataSourceName, String strUID, String strPSWD)
- setConnection(String dataSourceName, String strURL, String strUID, String strPSWD, String strJdbcDriver, boolean fetchSupportInfo)
- setConnection(String dataSourceName, String strURL, String strUID, String strPSWD, String strJdbcDriver)
These methods enable users to set the connection information before running a report. You can let the user specify the user ID and the password before running a report to ensure security. Another application of this method is for users to be able to select a different database before running reports, in order to see different report results. Usually in this case, the two databases have the same structure which eases the work of having to build another catalog.
This method may be called as below:
setConnection("jdbc:Oracle:thin:@204.177.148.30:1521:orcl","scott","tiger","oracle.jdbc.driver.OracleDriver");
Parameters
- String strURL - The URL of the database. For the format of the URL, refer to the instructions of your JDBC driver.
- String strUID - The user ID for the driver.
- String strPSWD - The user's password for the driver.
- String strJdbcDriver - The fully qualified name of the class. This class is responsible for connecting to the database and fetching data. For example, com.sybase.jdbc.SybDriver or oracle.jdbc.driver.OracleDriver. If not specified, the default one will be used.
- boolean fetchSupportInfo - Set to true to get the user support information from the DBMS. This class will only work when the user has set the connection object or URL.
