Copyright (c) 2017 OpenInformix. All rights reserved.
Licensed under the Apache License, Version 2.0
The source code for Informix ODCB Examples are at src directory. The IfxOdbcSample1 directory has ODBC application build infrastructure; including a Visual Studio 2015 project.
Client side SSL configuration setup needed for drivers to connect Informix server on the cloud.
Please see the official page for more up-to-date information and it is Getting started AWS
Let us consider a scenario we would like to run the sample application against an Informix server provisioned from AWS.
- The database server may not have created a user that can be shared with applications.
- A client computer on the internet connecting to this server will be using SSL connection.
SSH to the terminal system at AWS and do the following setup by using dbaccess
# The 'my-private-key1.pem' is the private key file you have created for your AWS
ssh -i ~/.ssh/my-private-key1.pem [email protected]
# Copy the certificate to the user folder that can be accessed later
cd /home/centos
sudo cp /home/informix/client_ssl/client.kdb .
sudo cp /home/informix/client_ssl/client.sth .
sudo chown centos client.kdb client.sth
# from remote (client) computer later you may scp those certificates as centos user
scp -i ~/.ssh/my-private-key1.pem [email protected]:/home/centos/client.* .
sudo -u informix bash
dbaccess
CREATE database db1 with log;
create user dbuser1 with password 'mypwd123' properties USER nobody authorization (DBSA);
GRANT CONNECT TO dbuser1;
GRANT DBA TO dbuser1;
Copy the following two files to your client computer
/home/informix/client_ssl/client.kdb
/home/informix/client_ssl/client.sth
# it has been copied to /home/centos
scp -i ~/.ssh/my-private-key1.pem [email protected]:/home/centos/client.* .
# to avoid security risk, once after copied the certificate files to the client computer, you may delete
rm /home/centos/client.kdb
rm /home/centos/client.sth
On your client computer copy client.kdb and client.sth to a secure location
let us say you have decided to put it at c:\informix\etc\ssh on your windows client and $INFORMIXDIR/etc/ssh on your Linux client. Then update the information in $INFORMIXDIR/etc/conssl.cfg of your client computer. The $INFORMIXDIR is the locaiton where you have installed Informix Client SDK.
SSL_KEYSTORE_FILE c:\informix\etc\ssl\client.kdb
SSL_KEYSTORE_STH c:\informix\etc\ssl\client.sth
SSL_KEYSTORE_FILE $INFORMIXDIR/etc/ssh/client.kdb
SSL_KEYSTORE_STH $INFORMIXDIR/etc/ssh/client.sth
Here is a sample connection string that you may use it for ODBC application to connect to the database. The same setup is applicable for application using these the folloing Informix drivers
ODBC, .NET, Noede.js, Python, R, ESQLC and OLE DB.
char *MyLocalConnStr =
"DRIVER={IBM INFORMIX ODBC DRIVER (64-bit)};HOST=ec2-54-196-209-131.compute-1.amazonaws.com;\
SERVER=ol_aws;SERVICE=9089;PROTOCOL=olsocssl;DATABASE=db1;UID=dbuser1;PWD=mypwd123;\
CLIENT_LOCALE=en_us.8859-1;DB_LOCALE=en_us.utf8";
- ODBC Fundamentals
- C Data Types in ODBC
- Column-Wise Binding
- Row-Wise Binding
- SQLGetDiagRec and SQLGetDiagField
- Using SQLBindCol
- Converting Data from SQL to C Data Types
- Transactions in ODBC
- Character Data and C Strings
- Date, Time, and Timestamp Literals
- Data Length, Buffer Length, and Truncation
- Writing ODBC 3.x Applications
- Asynchronous Execution