JReport Designer provides connection plugins for the most commonly used relational databases: Oracle, MySQL, MS SQL Server and PostgreSQL, to include the JDBC drivers required for these databases for an easy connection setup procedure.
A connection plugin can have its own driver, configuration dialog and logo. The configuration dialog defined in a plugin can be used to create a connection to the database and can get driver from the plugin. By default MySQL driver is not included in the plugin and need to be provided by users.
To set up a JDBC connection to connect to the Oracle/MySQL/SQL Server/PostgreSQL database via plugin:
Do one of the following:
On the Start Page, click Oracle, MySQL, SQL Server or PostgreSQL in the Connect category. In the Create Connection dialog, specify an existing catalog or create a new one and click OK.
In the Catalog Manager, right-click a data source and select New JDBC Connection from the shortcut menu, then click Oracle, MySQL, SQL Server or PostgreSQL in the Select Connection Type dialog.
In the Catalog Manager, select a data source and click New Data Source on the toolbar. In the New Data Source dialog, specify the name of the data source, then select the Oracle, MySQL, SQL Server or PostgreSQL connection type and click OK.
For MySQL, if its driver cannot be found, the Add Driver dialog will be displayed. Click Add to select the MySQL driver jar file from your local disk. Then click OK and the driver will be loaded into the MySQL connection plugin.
The Driver drop-down list displays the driver included in the connection plugin by default.
For Oracle, from the Connection Type drop-down list choose whether to use ServiceName, SID, or TNSName to connect to the database. Then in the text box of Service Name/TNS Name which corresponds to the connection type, specify the service name or TNS name of the database instance.
For MySQL/SQL Server/PostgreSQL, you need to specify the name of the database or schema in the Database text box.
In the Server text box, specify the host name or IP address of the database server.
Specify the port of the database server in the Port text box.
Specify
the user ID and password used for accessing the database.
If you want to use URL to specify the connection information, select the Show URL checkbox and then configure the necessary information. To test whether the specified information is workable, click the Test Connection button.
If your database has some special requirements, you can click the More Options button to modify the options according to your requirements.
Click OK and the connection will be added in the specified catalog in the Catalog Manager.
You can then add DBMS objects from the database into the JReport catalog via the connection.