The following is a guide on how to set up Flux with the five supported databases, using both code and the configuration file (.fec). Flux is tested and supported against the following five databases: DB2, MySQL, Oracle, SQL Server, and Sybase (ASE and ASA).
Database configuration through the Flux Engine Configuration (.fec) file
- First, you will need to download the appropriate database driver and place it into your flux-x-y-z/lib directory or in some other easily accessible location. See the separate sections below, to find a link for the appropriate JDBC driver download.
- Second, create a new .fec file in your flux-x-y-z/config directory and name it something like "Your database type"-config.fec. In your new .fec file add the following lines:
DATABASE_TYPE="Look below for your database information"
DRIVER="Look below for your database information"
URL="Look below for your database information"
JDBC_USERNAME=userName
JDBC_PASSWORD=password
REGISTRY_PORT=1099
MAX_CONNECTIONS=20
CONCURRENCY_LEVEL=15
Note: You can set registry port to any open port you want to use. Also, make sure that MAX_CONNECTIONS is higher than CONCURRENCT_LEVEL. This is done to give Flux the extra internal connections it needs. For information about correctly setting
MAX_CONNECTIONS and CONCURRENCT_LEVEL, see
Max Connections and Concurrency Level.
- Next, you will need to create a start up script. The easiest way to do this is to copy an existing one. For example, copy the start-unsecured-flux-engine.bat file and rename the copy to something like "Your database type"-flux-engine.bat.
- Now you will want to edit the start up script you just created. At the end of the classpath line you will want to change the .fec file to reference the .fec file you just created. You will also want to add your database driver to the classpath argument.
Database configuration through code
If you are running Flux using code, add the following to you engine configuration.
config.setDatabaseType(DatabaseType."Look below for your database information");
config.setDriver("Look below for your database information");
config.setUrl("Look below for your database information");
config.setJdbcUsername("userName");
config.setJdbcPassword("password");
config.setRegistryPort(1099);
config.setMaxConnections(20);
config.setConcurrencyLevel(15);
After you have chosen a database, you will need to configure your database with the correct Flux tables. To insert the Flux tables into your database, navigate to flux-x-y-z/doc and locate the correct SQL script for your database. Once you have found the correct SQL script, you can use that to insert the tables into your database. If you are using MySQL, please note that the mysql.sql script will not work with MySQL 5. You will need to use mysql5.sql.
When creating the database tables for Flux, you will want to make sure that you are creating the tables with the same user that you are using with Flux to connect to the database, doing this can help prevent permission issues that may arise. For example, if you login as "admin" to create the tables, but use the user "flux" to connect to the database, this may cause permission issues.
If you have followed these steps, you should now have an engine that can successfully connect to one of our supported databases.
Below are the database specific configuration options:
DB2
database_type: DB2
DRIVER: com.ibm.db2.jcc.DB2Driver
URL: jdbc:db2://<host>:<port50000>/<database>
Download Driver for DB2
SQL Server 2005
database_type: SQL_SERVER
DRIVER: com.microsoft.sqlserver.jdbc.SQLServerDriver
URL: jdbc:sqlserver://<host>:<port1433>;DatabaseName=<database>
Download Driver for SQL Server 2005
Oracle
database_type: ORACLE
DRIVER: oracle.jdbc.OracleDriver
URL: jdbc:oracle:thin:@<host>:<port1521>:<database>
Download Driver for Oracle
MySQL
database_type: MYSQL
DRIVER: com.mysql.jdbc.Driver
URL: jdbc:mysql://<host>:<port3306>/<database>
Download Driver for MYSQL
Sybase ASA
database_type: SYBASE_ASA
DRIVER: com.sybase.jdbc3.jdbc.SybDriver
URL: jdbc:sybase:Tds:<host>:<port2638>/<database>
Download Driver for Sybase