Connect to the Database

SymmetricDS requires a properties file with settings to connect to the database. The same properties can be used by the SymmetricDS service (sym_service), command line launcher (sym), administrative tools (symadmin), and utilities (dbexport, dbimport, dbfill).

By default, SymmetricDS will search the following locations for database properties:

Order Location Description
1 conf/symmetric.properties Contains properties that apply to all engines. You would set database properties here when running in single-server mode. Most installations use multi-server mode and should use the properties file from the engines folder instead.
2 CLASSPATH:symmetric-override.properties An override file applying to all engines that is found in a folder listed in the CLASSPATH environment variable.
3 engines/*.properties In the engines folder, each property file contains properties for a specific instance of SymmetricDS.

You can also specify which properties file should be used by passing command line options:

–properties
Setting this option will specify the properties file to use for connecting to the database. If this option is not used, it will search for properties as described above.
–engine name
If you are running multiple engines in the same SymmetricDS server (called multi-server mode), then you can specify which engine to use. The engine name can be found as property “engine.name” in a properties file under the “engines” folder. It will match the engine name you specify and use that property file for connecting to the database.

Required Properties

The following properties are required for connecting to the database:

db.passwordThe password for the user

Property Name Description
db.driver The class name for the JDBC driver
db.url The JDBC URL that specifies the host, port, and database name to connect to
db.user The user to connect as

Example Settings

Here are some examples of the settings:

Database db.driver db.url
MySQL com.mysql.jdbc.Driver
jdbc:mysql://localhost/sampleroot?tinyInt1isBit=false
Oracle oracle.jdbc.driver.OracleDriver
jdbc:oracle:thin:@127.0.0.1:1521:sampleroot
PostgreSQL org.postgresql.Driver
jdbc:postgresql://localhost/sampleroot?stringtype=unspecified
Apache Derby org.apache.derby.jdbc.EmbeddedDriver
jdbc:derby:sampleroot;create=true
HSQLDB org.hsqldb.jdbcDriver
jdbc:hsqldb:file:sampleroot;shutdown=true
Microsoft SQL-Server net.sourceforge.jtds.jdbc.Driver
jdbc:jtds:sqlserver://localhost:1433;useCursors=true;bufferMaxMemory=10240;lobBuffer=5242880
IBM DB2 com.ibm.db2.jcc.DB2Driver
jdbc:db2://localhost/samproot
IBM Informix com.informix.jdbc.IfxDriver
jdbc:informix-sqli://localhost:9088/sampleroot:INFORMIXSERVER=ol_ids_1150_1
Embarcadero Interbase interbase.interclient.Driver
jdbc:interbase://localhost//opt/interbase/data/sampleroot.gdb
H2 org.h2.Driver
jdbc:h2:sampleroot;AUTO_SERVER=TRUE;LOCK_TIMEOUT=60000

Many of the JDBC drivers are already included in the SymmetricDS download. If the driver is not included for your database, you will need to download it to the lib folder where SymmetricDS is installed.