Monthly Archives: August 2016

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

QSYS/PING RMTSYS(example.com)
QSYS/TRACEROUTE RMTSYS(example.com)
QSYS/NETSTAT

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

PASE/AIX/IBM’s Unix tools for networking

NetCat
Downlaod: http://www.perzl.org/aix/index.php?n=main.netcat
Nmap 
Downlaod: http://www.perzl.org/aix/index.php?n=main.nmap
iperf 
Downlaod: http://www.perzl.org/aix/index.php?n=Main.iperf
Openssl (usually already installed)

openssl s_client -connect example.com:443

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

wget http://www.oss4aix.org/download/RPMS/netcat/netcat-1.10-2.aix5.1.ppc.rpm
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 127.0.0.1 45678

Send a message to the server

$ netcat 127.0.0.1 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.

reference: http://deice.daug.net/netcat_speed.html

 

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.
osi

Advertisements

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 http://www.ibm.com/support/knowledgecenter/ssw_ibm_i_71/rzahh/jdbcproperties.htm 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 http://pub400.com/signup.html

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

3. Download and install Netbeans https://netbeans.org/ .  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 PUB400.com

User Name: <Your username for PUB400>
Password: <Your password for PUB400>
JDBC URL: jdbc:as400://pub400.com/{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

https://godzillai5.wordpress.com/2016/08/21/jdbc-jt400-setting-to-get-crud-and-show-sql-features-added-in-netbeans-with-ibm-db2-for-i/