Setting up Vagrant

You’ll need Virtual box so download and install that

Then you’ll need vagrant

You can check out the getting started guide here:

Simple example:

Open a terminal session (iTerm2 on mac or cmder windows) and run:

vagrant init hashicorp/precise64
vagrant up
vagrant ssh
vagrant destroy

Lets make our own

mkdir MyFirstVagrant
cd MyFirstVagrant/
vagrant init

Lets commit it to a github repo so we have source control on it.  Go to and create a repo.  Replace the url below with your .git file.

echo "# Vagrants" >>
git init
git add
git commit -m "first commit"
git remote add origin
git push -u origin master

Lets find a box we want to add to our vagrantfile

I chose the most popular vagrant ubuntu/trusty64.  Edit the vagrantfile and Below “Vagrant.configure(“2″) do |config|” add: = “ubuntu/trusty64”
config.vm.box_version = “20160926.0.1”

exit your editor and do

vagrant up
vagrant ssh

Then you have your ubuntu server to setup how you want.

Example of setting up PHP 7 dev vagrant:

Provisioning w/ external shell script:

  config.vm.provision "shell", path: ""

in you could run an update and install of apache, php:

sudo apt-get -y update
sudo apt-get -y install apache2 php7 libapache2-mod-php7

Give a network IP address "private_network", ip: ""

Want to do this on a power System?  Well VirtualBox doesnt appear to support powerpc so looks like you have to use powerkvm instead.

How to use Vagrant with PowerKVM

Execute SQL remotely on an IBM i via PHP’s PDO ODBC from a Windows or Linux

You’ll first have to configure an ODBC connection “System DSN”/”System Data Source” via the “iSeries Access ODBC driver” or it might be call the IBM i Access driver which you can learn how to download and install here:

Here’s some of the ways to configure the odbc connection

Once you have the ODBC connection setup you can use it in PHP and here’s a Simple Example on how to execute SQL remotely and safely on an IBM i via ODBC.  Note you won’t want to dump the error info in production its there to alert you about errors.

Here’s an example on how to run a SQL extenal stored procedure


Make sure to enable SSL to encrypt your SQL statements that are sent



Run C:\Windows\SysWOW64\odbcad32.exe and edit connection options and make sure ssl is selected or IBM i navigator is defaulted to sslodbc windows secure.png


Setup stunnel

guide is here: under 2.6 Encrypt the connection with Secure Sockets Layer

Other References:

IBM i Debugging Networking issues

Various ways to debug networking issues on an IBM i using the 5250 or SSH.

5250 Commands for debugging networking on the IBM i


or you could download Perzl binaries and run various AIX/Unix tools for networking.

PASE/AIX/IBM’s Unix tools for networking

Openssl (usually already installed)

openssl s_client -connect

Example of downloading and installing a tool from perzl’s website

rpm –ignoreos –ignorearch –nodeps –replacepkgs -hUv netcat-1.10-2.aix5.1.ppc.rpm

group system does not exist - using root
netcat                      ##################################################
Example of using netcat
Listen on a server socket :
$ netcat -l -p 45678
In a new terminal session connect to the local server socket from client
$ netcat 45678

Send a message to the server

$ netcat 45678 
Hello Server this is the client
On the server we should see :
$ netcat -l 45678
Hello Server this is the client

ctrl+c twice to break out of the connection

Bandwidth Test

Measure the actual network speed between your IBM i and your computer as network packets traverses various ethernet/wifi cards, wired/wireless connections, routers and switches.



OSI Networking Layers

Below is the OSI model which is the way communications between computer systems usually travel from a high level view without digging into the technologies used.

JDBC JT400 setting to get CrUD and Show SQL features added in Netbeans with IBM DB2 for i

I finally figured out the missing connection property needed so that Netbeans will allow you to add, edit, and delete rows with inline editors and selected rows.  In addition to showing SQL Scripts for Create,Insert,Delete and Update.  It is the extended metadata property which is by default set to false and needs to be set to true.  I found this out by looking the jdbc properties at and looking for properties effecting read only status, which is why those features were blocked on Netbeans.

In your connection properties add

extended metadata=true

by right clicking your connection in the database panel of netbeans while disconnected and going to properties

Screen Shot 2016-08-21 at 5.45.29 PM.png

Click the ellipses …) next to connection properties
Screen Shot 2016-08-21 at 5.45.53 PM.png

Click under the property column and type extended metadata.  Click under Value and type true

Screen Shot 2016-08-21 at 5.46.28 PM.png

Now run a SELECT statement and you’ll be able to Create, Update and Delete records by using the icons above the result set or by right clicking the result set area and using the context menu.  Which also had the Show SQL Scripts for CrUD.

Screen Shot 2016-08-21 at 5.28.59 PM.png

DB2 for i in the Cloud – Connecting to PUB400 via JDBC in Netbeans

1.Sign up for an account at

2. Download and extract jtopen which contains lib/jt400.jar driver for connecting to an IBM i

3. Download and install Netbeans .  I do the PHP bundle, but i believe they all have the Database module.

4. Go into the “services” tab under database and right click the Drivers folder and click “New Driver”Screen Shot 2016-08-20 at 7.30.57 PM.png

Find where you extracted JT400 and select lib/jt400.jar

Screen Shot 2016-08-20 at 7.32.19 PM.png

Press the “Find” button so it can find the AS400JDBCDriver class in the jar file and give the driver a name like “JT400 JDBC Driver”

Screen Shot 2016-08-20 at 7.34.55 PM.png

Right click the driver and click “connect using” Screen Shot 2016-08-20 at 7.36.33 PM.png

Fill out the connection wizard with your information given to you from

User Name: <Your username for PUB400>
Password: <Your password for PUB400>
JDBC URL: jdbc:as400://{replace curly bracket and this with your schema name}

Screen Shot 2016-08-20 at 7.09.37 PM.png

After clicking next, Select your Schema

Screen Shot 2016-08-20 at 7.10.21 PM.png

Give the connection a name

Screen Shot 2016-08-20 at 7.10.38 PM.png

Now you can connect to the DB2 for i in the cloud by right clicking the connection and pressing connect

Screen Shot 2016-08-20 at 7.46.26 PM.png

Now you have an easy to get to database connection to a sandbox DB2 for i!  Time to play with the temporal table support and other new enhancements for DB2!

Screen Shot 2016-08-20 at 7.48.05 PM.png

After connecting, your connection properties should show what settings are being used on the connection and even what version of the DB2.  In this case the server is on V7R2m0 :

Screen Shot 2016-08-20 at 7.13.29 PM.png

Step2 add CrUD features by modifying the connection property