Add H2 JDBC Driver to SuperCHANNEL
JDBC (Java Database Connectivity) is a programming interface that lets Java applications access a relational database.
SuperCHANNEL needs a JDBC driver so that it can access the relational database system (e.g. SQL Server, Oracle, etc) where your source data is stored.
Before you can run SuperCHANNEL, you need to install the appropriate JDBC driver and configure SuperCHANNEL so that it can access the driver.
In most cases the JDBC drivers are supplied by the database vendors. STR does not supply the drivers.
H2
H2 is a relational database management system (RDBMS) written in Java. It is open source and can be embedded in Java applications or run in the client-server mode.
H2 can be used with SuperCHANNEL, and is generally a more successful target than other RDBMS products when harvesting records from a SuperSTAR database by the "reverse channel" process (SuperSTAR database as source, RDBMS as target).
Step 1 - Download and Install the Driver
- Download the latest version of the H2 driver from http://www.h2database.com/html/download.html (select either the Windows Installer or the Platform Independent version).
- Extract the driver file from the download. The driver file is a .jar file, and will be named something like h2-1.3.171.jar
-
Copy the driver file to the drivers directory in your SuperCHANNEL installation. If you chose the default installation options, the location will be: C:\Program Files\STR\SuperCHANNEL\jar\drivers
Depending on your system configuration, you may need administrator permissions to copy to this directory. If you are prompted to provide administrator permissions, click Continue.
Step 2 - Edit the SuperCHANNEL Configuration
- Locate the SuperCHANNEL configuration file, config.txt. If you chose the default installation options, this file will be located in C:\ProgramData\STR\SuperCHANNEL\bin
Make a backup copy of this file before making any changes.
- Open config.txt in a text editor.
-
Locate the line that defines the Java Class Path variable (
java.class.path
), and add the following to the end of the line:
$(SNU_PROGRAM_HOME)\jar\drivers\h2-1.3.171.jar;
Notes
Replace
h2-1.3.171.jar
with the filename of the driver you installed.$(SNU_PROGRAM_HOME)
is a predefined variable that refers to the SuperCHANNEL program files directory.Each entry in the Java Class Path definition must be separated by a semi colon, and there must also be a semi colon at the end of the line.
-
Locate the line that defines the
jdbc.drivers
and add the following to the end of the line:
:org.h2.Driver
Note
Each entry in the
jdbc.drivers
definition must be separated by a colon. -
Save config.txt.
The following example shows the two additions to the configuration file:
Step 3 - Start SuperCHANNEL
Start SuperCHANNEL, and use the following connection string to connect to H2:
jdbc:h2:/C:/test/h2test04;AUTO_SERVER=TRUE;IGNORECASE=true;MODE=MySQL
Where:
C:/test
is the directory where your H2 database is stored.h2test04
is the database file name (do not include the file extension).
Some of the parameters on the connection string will depend on your particular implementation of H2. Often it is a good idea to also use the FILE_LOCK=NO parameter, particularly if you are also using the web browser console for H2.
You will also need to provide user credentials (for H2 authentication) and a schema name for connection to succeed:
Step 4 - Add Drivers to SNU
This step is optional. If you intend to run SuperCHANNEL from the command line or via scripting, you should also add the drivers to snu.bat. This is the SuperCHANNEL batch file, located in C:\ProgramData\STR\SuperCHANNEL\bin by default.
Make a backup copy of this file before making any changes.
Add the driver entry to the last statement in the file. This is the Java call to execute the program.