Javalee DB2Java supports all kinds of relational databases, as long as the user can provide a JDBC driver and its configurations.
To add or just change any RDBMS (Relational Database Management System), you must edit the configurations file db2java.conf located at the conf directory.
In this file, you will the section:
## RDBMS Configurations ##
In this section you will see an entry like this:
rdbms=mysql;oracle;mssql;postgres;firebird
Here you see all the RDBMS entries specified in the config file. To add, change or remove any RDBMS you must change this property first. All the RDBMS entries are separated by a semi-colon character. No spaces are accepted.
For each entry configured in the above property, there is an existing set of properties that configure that specific RDBMS entry. See the example bellow for mysql:
rdbms.mysql.label=MySQL
rdbms.mysql.driver=org.gjt.mm.mysql.Driver
rdbms.mysql.url=jdbc:mysql://$host:$port/$database
rdbms.mysql.port=3306
So, this is the configuration set for MySQL support. You can see that it informs to the program, the label that will be displayed in the program, the fully qualified class name of the JDBC driver, the URL and the default port number.
See that the URL has some special character on it. This is necessary so the Javalee DB2Java can replace the special words with the values defined by the end-user. In the URL you MUST put $host that will be replaced with the host name or IP address, also you MUST put $port where will be replaced with the port number, and you can optionally put $database to be replaced with the database name. It will depend strictly on the URL demanded by the JDBC driver in use. For more details, see the JDBC driver's documentation.
The JDBC driver of the new configured RDBMS should be type 4 and provided by the user. Just put the JAR file wih the JDBC driver in the lib directory.
You must restart the program so the changes can take effect. |