Setting the connection information

The method setConnection(String strURL, String strUID, String strPSWD, String strJdbcDriver) is for you to set connection information.

Where,

This method is for JRRunViewer and JRDirectViewer. It enables you to set connection information before the running of a report. You can allow others to specify the user ID and password before the running of a report to ensure security. Another application of this method is to enable users to select a different database before the running of a report, so that they can see different report results. Usually in this case, the two databases have the same structure, which eases the work of having to build further catalogs.

For example, this method can be called as follows:

setConnection("jdbc:Oracle:thin:@204.177.148.30:1521:orcl","scott","tiger","oracle.jdbc.driver.OracleDriver");