Q&A: IBM i ODBC Driver

Stephanie Rabbini

I recently caught up with Seiden Group CTO Stephanie Rabbani about the ODBC driver that’s quickly becoming standard for open source and web connections on Db2 for i.

Steph, looks like ODBC is back! Where has it been for the past 20 years?

I guess it was hibernating! With the ODBC standard, IBM Rochester no longer needs to create and maintain unique adapters for all the new languages coming to the platform. Most languages can already use ODBC. What’s more, IBM already maintained ODBC drivers for Windows and Linux, so why not the IBM i itself? And now Apple Mac computers. Plus, ODBC works really well.

How are you using ODBC with PHP these days?

ODBC is the default driver for Seiden Group CommunityPlus+ PHP. Because Zend Server Basic is being discontinued next year, we’re helping lots of clients migrate!

We also maintain and support high quality 64-bit builds of ibm_db2 and PDO_IBM for clients who use the db2_connect() style and PDO_IBM.

Which PHP extensions do you use for ODBC? 

PHP provides a choice of two ODBC extensions: ‘odbc’ and ‘PDO_ODBC.’ We usually prefer PDO_ODBC. Not only is PDO_ODBC compatible with other PDO database extensions, but it does more than the old ‘odbc’ extension. For example, PDO_ODBC can read output parameters from Db2 for i stored procedures.

Any other languages?

I love Python (let us know if you need Python code developed or need training!) and use pyodbc. We have also been developing APIs with Node.js and node-odbc. Oh, and let me know if you’d like to see how I produced beautiful graphs based on IBM i data with the R language and RODBC.

What do other developers say about ODBC being available on IBM i?

They love being able to run the same code from their PCs and on IBM i, connecting to Db2 for i from both. They can use their “local” development tools while programming, then deploy to the i.

How do you install the ODBC driver?

It’s free for IBM i customers. The package has two parts: the unixODBC driver manager and a specific Db2 for i driver. You’ll need your IBM user ID to log in to the Access Client Solutions site and download the package. Official installation instructions:

https://ibmi-oss-docs.readthedocs.io/en/latest/odbc/installation.html

How easy is ODBC to configure?

As a programmer who likes to dive right in, I love simple INI files where I can try all the options. And INI files (odbc.ini and odbcinst.ini, both in /qopensys/etc/) are what unixODBC gives us. There are a ton of options, and best of all, they are well documented.

We often refer to the list of IBM i ODBC Driver Connection String Keywords .

For general unixODBC documentation: http://www.unixodbc.org/odbcinst.html

What about performance?

My testing with Neoload shows better performance with less CPU than the older proprietary drivers! For best speed, I recommend either connection pooling, or persistent connections if your language supports it.

Thanks, Steph! Any other words of wisdom?

I love to help people get started with ODBC and open source on IBM i. Why not save yourself some time? Contact me if you’d like me to walk you though the installation on your system and make sure it all works perfectly!

4 replies
  1. Jon Paris
    Jon Paris says:

    The “run the same code on your PC” part is the really attractive thing to me. It would be even more attractive if I could get it to work on my Mac. I have tried several times without success.

    Perhaps Steph could do a follow-up pice to explain how to get this to work?

    Reply

Leave a Reply

Want to join the discussion?
Feel free to contribute!

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.