1

My requirement is simple: I have a Rails web app that needs to read some data in from DB2 running on an iSeries AS400.

With the incredible help of the ibm_db gem maintainers, I believe I've been able to solve the technical hurdle of connecting to the DB2 instance.

The backstory is here if there are others looking for guidance:

https://github.com/ibmdb/ruby-ibmdb/issues/25

Briefly:

  1. Download the DB2 CLI/ODBC package provided for Linux/OSX
  2. Set some environment variable and some connection config
  3. Attempt a connection.
  4. Leverage sequel gem in conjunction with ibm_db gem.
  5. It should work!!

Sadly, I'm now blocked on #3 by this error:

[FAILED]: [IBM][CLI Driver] SQL1598N An attempt to connect to the database server failed because of a licensing problem. SQLSTATE=42968

I've been in touch with 3 different people at IBM in an attempt to resolve this and I'm constantly pointed to an article about DB2 Connect licenses with a cost of over $10K. iSeriesAccess (formerly ClientAccess) is available for Windows/Linux but is a heavy package and doesn't have an OSX counterpart.

I did find this question (License ERROR with DB2 driver on linux) but this I believe this assumes DB2 on Linux, not OS400.

Has anybody in the SO community had any luck or experience with this sort of thing?

Community
  • 1
  • 1
Brent
  • 411
  • 4
  • 11
  • 1
    Hm, did you try the JDBC (java) variant of the driver. I guess you could use it with jruby. I haven't seen license restrictions with that type of connection yet. And you can use the [JTopen400](http://jt400.sourceforge.net/) freely distributable version of the driver. – eckes Apr 17 '15 at 19:07
  • @eckes, no. JRuby really isn't an option for me due to use of other gems in my solution. I could use the iSeries Access library Linux package, but sadly there is no Mac OSX variant to leverage during development. – Brent Apr 17 '15 at 19:16
  • This probably won't help, but there's a new client solution "IBM iAccess Client Solution" that works on both Windows and Linux. It is java based and includes a separate OS specific package with ODBC drivers ect. http://www-03.ibm.com/systems/power/software/i/access/solutions.html – Charles Apr 17 '15 at 20:27
  • Have you looked at [RubyJavaBridge](http://rjb.rubyforge.org/)? Not my area, but perhaps it could enable you to use JTopen? – WarrenT Apr 24 '15 at 19:09
  • @Charles, yes iSeries Access is a fallback for me at this point. Sadly no OSX version that contains an ODBC driver. – Brent Apr 25 '15 at 03:10
  • @WarrenT I haven't looked at RubyJavaBridge, though in the interim I've been using a ODBC to JDBC bridge from a company called OpenLink to do get to JTopen on OSX. I'll take a look there, thanks! – Brent Apr 25 '15 at 03:13

2 Answers2

2

For ODBC connections to an IBM i database, there are two options:

  • Use DB2 Connect Unlimited Edition for System i (extra cost)
  • Use IBM i Access ODBC driver (included with OS licensing / SWMA)

The IBM i Access ODBC driver is delivered with Client Access iSeries Access IBM i Access for Windows 7.1 or the IBM i Access Client Solutions Application Packages, which are currently only available for Windows and Linux. If people are interested in a Mac OS X version of the IBM i Access ODBC driver please vote on this RFE.

For ibm_db connections to an IBM i database, there are also two options:

  • Running on Linux/Mac/Windows/...: use DB2 Connect Unlimited Edition for System i (extra cost)
  • Running on IBM i: Use native IBM i CLI (free)

So, if you're running production on IBM i, even if we added an IBM i Access ODBC driver for Mac OS X, it still wouldn't help you, since the ibm_db driver does not work with the IBM i Access ODBC driver. :( You could use ruby-odbc in development and ibm_db in production, but I'm guessing you don't want to do that.

Now, if you're not running production on IBM i, you must be using DB2 Connect in production, so then I'd see if there were any more DB2 Connect licenses for you to use in development.

Kevin Adler
  • 641
  • 5
  • 16
0

this is the official IBM opensource repo for odbc drivers:

https://public.dhe.ibm.com/software/ibmi/products/odbc/

jacktrade
  • 3,125
  • 2
  • 36
  • 50