IBM® Db2® or a subsequent compatible version. The database server must support stored procedures, and hence must have the C compiler installed. Make sure that you have installed the Db2 Application Development Client as part of the Db2 server. If you plan to use the gcc compiler, log in as the UNIX user used to run the Db2 database server, and then you must run a command like this (all one line):.
db2set DB2_SQLROUTINE_COMPILE_COMMAND usr/vac/bin/xlc -I$HOME/sqllib/include SQLROUTINE_FILENAME.c -bE:SQLROUTINE_FILENAME.exp -e SQLROUTINE_ENTRY -q64 -o SQLROUTINE_FILENAME -L$HOME/sqllib/lib -ldb2
Search for “JDBC driver”.
The exact form of the command will depend on your environment: in particular, on the location of your C compiler. The -q64 flag is used only if Db2 is running in 64-bit mode. Check the Db2 documentation for details. Make sure that you set the codeset to be UTF-8; for example:
create database <database_name> USING codeset UTF-8 territory US collate using system DFT_EXTENT_SZ 2 CATALOG TABLESPACE managed by Database using (File 'catalogfile' 10000) USER TABLESPACE managed by Database using (File 'userfile' 10000) TEMPORARY TABLESPACE managed by Database using (File 'tempfile' 10000)
You must set the STMTHEAP database server parameter to 10000. You must set the APPLHEAPSZ parameter to at least 2048. You can update parameters by logging in to the Db2 database server and then entering:
>db2 update dbm cfg for database <database_name>using STMTHEAP 10000 >db2 update dbm cfg for database <database_name>using APPLHEAPSZ 2048
You must also ensure that the pagesize for the database is set to 16K. A default installation of Db2 sets the pagesize to 4K. The following Db2 commands increase the pagesize for a sample database:
create bufferpool datapool size 50 pagesize 16K
Restart the Db2 database server to activate the bufferpool:
db2stop force; db2start;
Create the tablespaces:
create system temporary tablespace temporary pagesize 16K managed by database using File(file) extentsize 2 bufferpool datapool create tablespace debsspace pagesize 16K managed by database using File(file) extentsize 2 bufferpool datapool
You can drop the USER tablespace so that your tablespace can be the default for everything that is created. Check your Db2 Universal Server documentation for further details.