Document Type | Technical Information
Category | Interface/Integration
Document Number | TIITI030
Overview
This article explains the detailed configuration steps to be performed after installing the Java Gateway.
It guides you on modifying the jgw.cfg file, copying the sqljdbc files, and registering the Gateway as a Windows service.
Method
Modifying the jgw.cfg File
Change the configuration values in the jgw.cfg file according to your operating environment. In particular, you must modify the gateway log file path.
# Target DB name DATABASE=SQL_SERVER # listener port LISTENER_PORT=9093 # initial thread pool size INIT_POOL_SIZE=10 # maximum thread pool size MAX_POOL_SIZE=1000 # gateway encoding (should be the same as DB Character Set) # ASCII, EUC-KR, MSWIN949, UTF-8, UTF-16, SHIFT-JIS ENCODING=MSWIN949 # max length for Types.LONGVARCHAR MAX_LONGVARCHAR=4K # max length for Types.LONGRAW MAX_LONGRAW=4K # gateway log file path LOG_DIR= C:\TmaxData\gateway\mssql\tbJavaGW\log # gateway log level LOG_LVL=2 # max log file size (0 means unlimited) MAX_LOG_SIZE=0 # max number of log files MAX_LOG_CNT=0 # size of data fetched per query (max 64K) FETCH_SIZE=32K
Copying the sqljdbc Files
To use the MS-SQL Java Gateway, you need the sqljdbc files provided by Microsoft.
After downloading, copy them to the %TBGW_HOME%\mssql\tbJavaGW\lib directory.
Registering the TbGateway Service
To register TbGateway as a Windows service, the Procrun module from the Apache Commons Daemon project is used.
The main files used for this are the following four:
- commons-daemon-1.0.6.jar: Service registration/unregistration engine module
- prunsrv.exe: Executable program
- prunmgr.exe: Service management program
- jgw_service.bat (for Tibero 5, service_gw.bat): TbGateway registration/unregistration script
1) Downloading the Operating Modules
Download commons-daemon-1.0.6.jar
http://archive.apache.org/dist/commons/daemon/binaries/commons-daemon-1.0.6-bin.zip
After extracting, copy the
commons-daemon-1.0.6.jar file to the %TBGW_HOME%\mysql\tbJavaGW\lib directory.
Download Windows Procrun
http://archive.apache.org/dist/commons/daemon/binaries/windows/commons-daemon-1.0.6- bin-windows.zip
After extracting, copy the prunmgr.exe and prunsrv.exe files under the %TBGW_HOME%\mysql\tbJavaGW directory.
2) Modifying jgw_service.bat
Open the jgw_service.bat (for Tibero 5, service_gw.bat) file in WordPad and set the JAVAGW_HOME_PATH (for Tibero 5, JAVAGW_HOME) value to the tbJavaGW location.
set JAVAGW_HOME= C:\TmaxData\gateway\mssql\tbJavaGW
Also, if the name of the
sqljdbc file copied in step 2.2 is not sqljdbc.jar or sqljdbc4.jar, you need to modify the following content accordingly.
set PR_CLASSPATH=%JAVAGW_HOME%;%JAVAGW_LIB%\%JAVAGW_DAEMON%;%JAVAGW_LIB%\%COMMONS_DAEMON_ PATH%;%JAVAGW_LIB%\commons-collections.jar;%JAVAGW_LIB%\commons- pool.jar;%JAVAGW_LIB%\jconn3.jar;%JAVAGW_LIB%\log4j- 1.2.15.jar;%JAVAGW_LIB%\sqljdbc.jar;%JAVAGW_LIB%\sqljdbc4.jar
3) Service Registration and Unregistration
Run the following commands in the tbJavaGW directory.
Service Registration
Tibero6 jgw_service.bat install Tibero5 service_gw.bat install
Service Unregistration
Tibero6 jgw_service.bat uninstall Tibero5 service_gw.bat uninstall
Note
For additional options, please refer to the Procrun documentation.