I'm a hacker and an early stage investor interested in solving common problems in the simplest way possible.
I'm also the creator of Sociaholic.com - A better way to post tweets to your facebook
Search
Tags
- ruby (5)
- metaprogramming (3)
- facts (2)
- interview (2)
- startups (2)
- 37signals (1)
- active record (1)
- api (1)
- bubble sort (1)
- client (1)
- View all 44 tags
- clojure (1)
- comparison (1)
- db2 (1)
- erlang (1)
- facebook (1)
- fun (1)
- functional programming (1)
- funding (1)
- ibm (1)
- ideatin (1)
- infographic (1)
- jason fried (1)
- java (1)
- jruby (1)
- lean startup (1)
- mainframe (1)
- market report (1)
- meta (1)
- mvp (1)
- paul graham (1)
- real-time (1)
- scala (1)
- sociaholic (1)
- social media (1)
- software development (1)
- sort (1)
- starling (1)
- star trek (1)
- steve jobs (1)
- twitter (1)
- venture (1)
- video (1)
- wrapper (1)
- y combinator (1)
Connecting to IBM DB2 (on a mainframe) using JRuby and Active Record (If you care)
I'm going to cut the bull crap about why JRuby is awesome and get to the point, I was trying to access an old IBM Mainframe for a batch program in JRuby and couldn't find any thing useful on the blogosphere, so I decided to share how I did it. It was pretty simple using the Active Record JDCB adapter
Setup:
- Mac OS 10.5
- jruby 1.4.0
- ruby 1.8.6
- activerecord (2.3.5) - gem
- activerecord-jdbc-adapter (0.9.4, 0.9.1) - gem
- rails (2.3.5) - gem
Step 1: Install and setup JRuby
Step 2: Install the necessary gems (rails and activerecord)
jruby -S gem install rails activerecord-jdbc-adapter
If you choose to avoid rails, you can install active record as standalone too.
Step 3: Install Drivers
Download the DB2 Type 4 JDBC Drivers and place them in the same directory as your program, you can find them in your DB2 installation. You will need the following:
- db2jcc-9.1.jar
- db2jcc_license_cisuz-1.0.0.jar
That's pretty much it, check out the code sample to get you started
Code:

2 Comments