15
Fri, Nov
2 New Articles

The iSeries Goes Open Source

Typography
  • Smaller Small Medium Big Bigger
  • Default Helvetica Segoe Georgia Times

Quick! Name three open source projects! The vast majority of us think of Linux, and that's pretty much it. Those of us who use WDSci (the WebSphere Development Studio client for iSeries) might include Eclipse. Those who program Java on the iSeries might include IBM's Java Toolbox. And after that, the pickings get mighty slim. And that makes sense, because iSeries and open source aren't exactly peanut butter and jelly.

SourceForge.net is the largest location for open source development anywhere on the 'net. This is not hype; there are currently approximately one hundred thousand open source projects registered there. Of that number, exactly seven are iSeries projects. And perhaps 20 other projects are somehow peripherally related to the box. So you can see that the iSeries is somewhat under-represented in the open source community, especially if you consider the fact that there are over 100 projects for the Amiga! But there's no reason there can't be more iSeries projects. Some nice projects do already exist. For example, David Morris' iSeries Toolkit resides there.

SourceForge may not be familiar to you, but it is really very easy to use. In this article, I will...

  1. Explain the new OS400Bridge project
  2. Outline the steps to create new open source projects on SourceForge
  3. Show you how to access the projects using WDSc

With these steps in hand, you'll be able to use this new open source project and then someday create and contribute your own.

The Project

The first step in creating an open source project is to identify a need. The project should appeal to as wide an audience as possible. If you're writing something that only you need, there's little point in making it open source, except perhaps for the sheer fun of it. But if you want your project to have some utility, you have to find a niche that has a demand but no current supply.

As a member of the JTOpen Core Team, I sometimes feel bad that I don't contribute much to the project. Honestly, that group is so focused and so capable that they don't need much from folks like me, and it's hard to find an area they haven't covered. But a while back, I got an email. Robert Upshall, another iSeries/Java convert like me, was asking about contributing to JTOpen. And from those discussions, our open source project, OS400Bridge, was born.

What Is OS400Bridge?

To understand the OS400Bridge project, you can go to SourceForge and read the blurb, or you can read it right here:

"OS400Bridge is intended to provide connectivity options for Java applications running on IBM's OS/400 (iSeries or AS/400 machines), allowing them to access databases throughout the network."

OS400Bridge will provide Java classes allowing a program running on OS/400 (or any other JVM-enabled OS) to use another machine as a proxy for JDBC access. In our first release, we intend to create a server running on a Windows platform, which will be accessed by a client on OS/400.

How Does JDBC Work?

The two simplest ways for a Java program to access a database via JDBC are to use either a Type 4 JDBC driver or the Type 1 JDBC/ODBC bridge. The former requires that the vendor (or some third party) release a Type 4 driver for the database in question, while the latter requires an ODBC driver. Very few vendors provide free Type 4 drivers, so the Type 1 driver is the more flexible approach. The architecture of an application using a Type 1 driver is shown in Figure 1.

http://www.mcpressonline.com/articles/images/2002/031218%20-%20Open%20SourceV400.jpg

Figure 1: A standard application using a Type 1 JDBC Driver works like this.

The Type 1 JDBC driver is really just a layer over the ODBC driver. The Java application can only work on a platform that has a native ODBC driver for the intended database. Unfortunately, few database vendors supply ODBC clients for OS/400.

However, nearly every vendor provides such drivers for Windows. The idea, then, is to allow OS/400 to take advantage of the wide array of ODBC drivers available for Windows. With OS400Bridge, requests on the OS/400 machine will be passed to the server running on the Windows box, which will in turn execute them using a Type 1 JDBC/ODBC bridge to the appropriate ODBC driver.

Implementation Details

The package as currently designed supports only a very limited set of operations: basically, the abilities to connect to and disconnect from a database and to execute simple updates and queries. We currently have no plans to support the more-advanced JDBC2 and JDBC3 functionalities, but that's a driving force behind making the project open source. That way, someone else can contribute those features.

http://www.mcpressonline.com/articles/images/2002/031218%20-%20Open%20SourceV401.jpg

Figure 2: OS400Bridge allows iSeries applications to use Windows ODBC drivers.

The package consists of a server that runs on the Windows machine (the "host") and accepts requests via TCP/IP sockets, as well as a server proxy class that the OS/400 application (the "client") uses to send requests to the server and receive results.

Our first objective is to get a simple protocol in place, so we'll probably use our own classes and methods on the client. In this sort of application, you will create a BridgeServerProxy object and send requests to it. Once the protocol is stable, we will then seek to wrapper the client classes inside the standard JDBC architecture so that you can use the standard DriverManager.getConnection() type of syntax to access the bridge.

Upcoming parts of the project include driver classes that will insulate the protocol from any ODBC differences, support for multiple databases and multiple servers, support for multiple clients, and configuration of the proxy from the client program. And of course, we will always look to extend the number of supported features.

Our goal is to provide a flexible, extensible server that can be used by any machine in the network to access databases on any other machine where such connectivity is not currently supported by the database vendor.

Why SourceForge?

So why is this project part of SourceForge instead of JTOpen? Well, the primary reason is that it really doesn't fit the JTOpen philosophy. Basically, JTOpen is more about using Java to access the iSeries, rather than using Java for the iSeries to access other things. And who knows, maybe after the project matures a little bit, the JTOpen folks will see that it really does make sense as part of the Java Toolbox for the iSeries. But for now, it's got to be a standalone project, and SourceForge is the unquestioned king of such projects.

Proving the Concept

The first thing Robert and I had to do was write enough code to make sure the concept worked. Before you start an open source project, the first thing to do is to divvy up the workload, and as it turns out the OS400Bridge project quite nicely divides itself into the server portion and the client portion. Robert took the client portion, which actually does the JDBC work, while I took the server part. I also took the communications protocol, which for now is actually pretty simple: We send a text request from the client to the server, and then the server sends the results back as a serialized object stream. This allows us to send whatever we need to send, from a Boolean to a result set to an exception. I suspect we'll use a slightly more robust protocol in a later version, but the code we have works.

And in fact, that's about where the project lies as I type this article. By the time the column is published, we may have a bit more in place, but right now all that's done is a proof of concept (well, it's a little better than that--Robert cleaned up the driver portion quite nicely, but my stuff is still really rough).

Create a Project

The next thing is to create a project on SourceForge. This isn't a detailed instruction manual, so I'll just address the major points. First, you will have to create a user. Do this using the New User via SSL option on the screen, as shown in Figure 3.

http://www.mcpressonline.com/articles/images/2002/031218%20-%20Open%20SourceV402.jpg

Figure 3: The SourceForge home page has an option to create a new user.

After going through a typical registration with email verification, you will be able to log back in and go to "my sf.net." After logging in, you'll see a personal page like the one in Figure 4, which will have an option to Register New Project.

http://www.mcpressonline.com/articles/images/2002/031218%20-%20Open%20SourceV403.jpg

Figure 4: Once you have logged in, you can register a new project.

You will need to go through many pages that explain the various ramifications of open source. On about the sixth screen, you will need to select a license type. This is a crucial choice. We selected LGPL because we want anyone to be able to use this code freely, even in commercial projects. We decided that the standard GPL license was a little too restrictive in that regard. There are constant debates in the public forums about which license to use, and you may want to take some time studying them to see which best fits your own personal philosophy of software development. You will also need to enter both short and long descriptions. Once you've done that, you will finally get to a page saying the project has been submitted for review.

Within 24 to 48 hours, you will get a response from the SourceForge folks telling you whether your project was accepted. Once the project is accepted, you will be the proud creator of a piece of open source software!

Now the Work Begins!

This is when the work actually begins. You've created the project, but you have no software. Someone has to actually upload the first cut of the software. But once that's done, the entire project is available through Concurrent Versions System (CVS), the industry standard source-control system. The nice thing about this is that WDSc is built to work with CVS.

If you decide to become a development member of the OS400Bridge project, you'll be able to attach to the repository in read/write mode, which will allow you to not only download the code, but also upload your changes. If it looks like you might like to do that, please contact me and we'll see about getting you access to the project.

Just Looking

If you just want to use the current code, you have a couple of options. The first is to wait for us to release a version of the software. By the time you read this column, we should have made some files available for download in the project's SourceForge page. Typically, we'll release a binary (a JAR containing all the classes) and a source zip file. We may also have a separate documentation file.

But if you want to play with the source yourself, you can always download the current version simply by attaching to the CVS repository. You will be able to "check out" the current version into a project in your workbench, and then you can start using the code yourself.

WDSC and SourceForge

I'll go through the steps required to attach to the CVS repository and check out the current OS400Bridge project into a project in your workspace. First, use the main menu to select Window->Open Perspective->Other. This brings up the prompt shown in Figure 5. Select the CVS Repository Exploring perspective and press OK. After this, your workbench will look like Figure 6.

http://www.mcpressonline.com/articles/images/2002/031218%20-%20Open%20SourceV404.jpg

Figure 5: Open the CVS Repository Exploring perspective.

http://www.mcpressonline.com/articles/images/2002/031218%20-%20Open%20SourceV405.jpg

Figure 6: You're in the CVS Repository Exploring perspective!

Right-click in the navigation pane (the left side, where the arrow is in Figure 6) and a pop-up menu will appear. From there, select New->Repository Location as shown in Figure 7 to bring up the repository location wizard. Enter the values as shown in Figure 8 and press Finish. You will see a repository in your application, as shown in Figure 9.


http://www.mcpressonline.com/articles/images/2002/031218%20-%20Open%20SourceV406.jpg

Figure 7: Create a new repository location.

http://www.mcpressonline.com/articles/images/2002/031218%20-%20Open%20SourceV407.jpg

Figure 8: Use the wizard to add a new CVS repository.

http://www.mcpressonline.com/articles/images/2002/031218%20-%20Open%20SourceV408.jpg

Figure 9: After successfully attaching to the repository, you will see the os400bridge project.

Expand the repository. You will see entries for HEAD, Branches, and Versions. Expand the HEAD entry to see the os400bridge project. Right-click on that project and select Check Out As Project, as shown in Figure 10.

http://www.mcpressonline.com/articles/images/2002/031218%20-%20Open%20SourceV409.jpg

Figure 10: This option will create a new project in your workbench and download the code.

At this point, if you switch to the Java perspective, you will see a new project, os400bridge, in your workbench, with all of the source members. You can copy the source from os400bridge into an existing project.

Checking Out into a Java Project

Another option is to use the Check Out As... option. With this option, you can tell WDSc what kind of project to create. Create a Java project. There's a slight problem with this, because our naming conventions currently assume that you will be using a source folder called "src," which is a convention in many projects. Use the properties dialog for the project to add a source folder called "source." If you're unsure how to do this, drop a line in the forums discussion section, and I'll outline it in a little more detail.

Running the Code

Once you've downloaded everything, you can then decide how you want to test it. As the system stands, there are capabilities to test with the AS/400 driver, which will allow you to access DB2 data on an iSeries; the MySQL driver, which will attach to a MySQL database; and an Access driver, which will allow you to read Microsoft Access databases. You will see in the os400bridge project a document called OS400Bridge Reference.doc. This file contains more details on running the software. The documentation is pretty sparse right now, but we plan to add more as time permits. Please feel free to try the code and make any comments on the forum provided at the project's SourceForge page.

That's it for this article. Please stop by the OS400Bridge project. I'll bring you up to date on its progress and on the participation of the community in a later article.

Joe Pluta is the founder and chief architect of Pluta Brothers Design, Inc. He has been working in the field since the late 1970s and has made a career of extending the IBM midrange, starting back in the days of the IBM System/3. Joe has used WebSphere extensively, especially as the base for PSC/400, the only product that can move your legacy systems to the Web using simple green-screen commands. Joe is also the author of E-Deployment: The Fastest Path to the Web and Eclipse: Step by Step. You can reach him at This email address is being protected from spambots. You need JavaScript enabled to view it..

Joe Pluta

Joe Pluta is the founder and chief architect of Pluta Brothers Design, Inc. He has been extending the IBM midrange since the days of the IBM System/3. Joe uses WebSphere extensively, especially as the base for PSC/400, the only product that can move your legacy systems to the Web using simple green-screen commands. He has written several books, including Developing Web 2.0 Applications with EGL for IBM i, E-Deployment: The Fastest Path to the Web, Eclipse: Step by Step, and WDSC: Step by Step. Joe performs onsite mentoring and speaks at user groups around the country. You can reach him at This email address is being protected from spambots. You need JavaScript enabled to view it..


MC Press books written by Joe Pluta available now on the MC Press Bookstore.

Developing Web 2.0 Applications with EGL for IBM i Developing Web 2.0 Applications with EGL for IBM i
Joe Pluta introduces you to EGL Rich UI and IBM’s Rational Developer for the IBM i platform.
List Price $39.95

Now On Sale

WDSC: Step by Step WDSC: Step by Step
Discover incredibly powerful WDSC with this easy-to-understand yet thorough introduction.
List Price $74.95

Now On Sale

Eclipse: Step by Step Eclipse: Step by Step
Quickly get up to speed and productivity using Eclipse.
List Price $59.00

Now On Sale

BLOG COMMENTS POWERED BY DISQUS

LATEST COMMENTS

Support MC Press Online

$

Book Reviews

Resource Center

  • SB Profound WC 5536 Have you been wondering about Node.js? Our free Node.js Webinar Series takes you from total beginner to creating a fully-functional IBM i Node.js business application. You can find Part 1 here. In Part 2 of our free Node.js Webinar Series, Brian May teaches you the different tooling options available for writing code, debugging, and using Git for version control. Brian will briefly discuss the different tools available, and demonstrate his preferred setup for Node development on IBM i or any platform. Attend this webinar to learn:

  • SB Profound WP 5539More than ever, there is a demand for IT to deliver innovation. Your IBM i has been an essential part of your business operations for years. However, your organization may struggle to maintain the current system and implement new projects. The thousands of customers we've worked with and surveyed state that expectations regarding the digital footprint and vision of the company are not aligned with the current IT environment.

  • SB HelpSystems ROBOT Generic IBM announced the E1080 servers using the latest Power10 processor in September 2021. The most powerful processor from IBM to date, Power10 is designed to handle the demands of doing business in today’s high-tech atmosphere, including running cloud applications, supporting big data, and managing AI workloads. But what does Power10 mean for your data center? In this recorded webinar, IBMers Dan Sundt and Dylan Boday join IBM Power Champion Tom Huntington for a discussion on why Power10 technology is the right strategic investment if you run IBM i, AIX, or Linux. In this action-packed hour, Tom will share trends from the IBM i and AIX user communities while Dan and Dylan dive into the tech specs for key hardware, including:

  • Magic MarkTRY the one package that solves all your document design and printing challenges on all your platforms. Produce bar code labels, electronic forms, ad hoc reports, and RFID tags – without programming! MarkMagic is the only document design and print solution that combines report writing, WYSIWYG label and forms design, and conditional printing in one integrated product. Make sure your data survives when catastrophe hits. Request your trial now!  Request Now.

  • SB HelpSystems ROBOT GenericForms of ransomware has been around for over 30 years, and with more and more organizations suffering attacks each year, it continues to endure. What has made ransomware such a durable threat and what is the best way to combat it? In order to prevent ransomware, organizations must first understand how it works.

  • SB HelpSystems ROBOT GenericIT security is a top priority for businesses around the world, but most IBM i pros don’t know where to begin—and most cybersecurity experts don’t know IBM i. In this session, Robin Tatam explores the business impact of lax IBM i security, the top vulnerabilities putting IBM i at risk, and the steps you can take to protect your organization. If you’re looking to avoid unexpected downtime or corrupted data, you don’t want to miss this session.

  • SB HelpSystems ROBOT GenericCan you trust all of your users all of the time? A typical end user receives 16 malicious emails each month, but only 17 percent of these phishing campaigns are reported to IT. Once an attack is underway, most organizations won’t discover the breach until six months later. A staggering amount of damage can occur in that time. Despite these risks, 93 percent of organizations are leaving their IBM i systems vulnerable to cybercrime. In this on-demand webinar, IBM i security experts Robin Tatam and Sandi Moore will reveal:

  • FORTRA Disaster protection is vital to every business. Yet, it often consists of patched together procedures that are prone to error. From automatic backups to data encryption to media management, Robot automates the routine (yet often complex) tasks of iSeries backup and recovery, saving you time and money and making the process safer and more reliable. Automate your backups with the Robot Backup and Recovery Solution. Key features include:

  • FORTRAManaging messages on your IBM i can be more than a full-time job if you have to do it manually. Messages need a response and resources must be monitored—often over multiple systems and across platforms. How can you be sure you won’t miss important system events? Automate your message center with the Robot Message Management Solution. Key features include:

  • FORTRAThe thought of printing, distributing, and storing iSeries reports manually may reduce you to tears. Paper and labor costs associated with report generation can spiral out of control. Mountains of paper threaten to swamp your files. Robot automates report bursting, distribution, bundling, and archiving, and offers secure, selective online report viewing. Manage your reports with the Robot Report Management Solution. Key features include:

  • FORTRAFor over 30 years, Robot has been a leader in systems management for IBM i. With batch job creation and scheduling at its core, the Robot Job Scheduling Solution reduces the opportunity for human error and helps you maintain service levels, automating even the biggest, most complex runbooks. Manage your job schedule with the Robot Job Scheduling Solution. Key features include:

  • LANSA Business users want new applications now. Market and regulatory pressures require faster application updates and delivery into production. Your IBM i developers may be approaching retirement, and you see no sure way to fill their positions with experienced developers. In addition, you may be caught between maintaining your existing applications and the uncertainty of moving to something new.

  • LANSAWhen it comes to creating your business applications, there are hundreds of coding platforms and programming languages to choose from. These options range from very complex traditional programming languages to Low-Code platforms where sometimes no traditional coding experience is needed. Download our whitepaper, The Power of Writing Code in a Low-Code Solution, and:

  • LANSASupply Chain is becoming increasingly complex and unpredictable. From raw materials for manufacturing to food supply chains, the journey from source to production to delivery to consumers is marred with inefficiencies, manual processes, shortages, recalls, counterfeits, and scandals. In this webinar, we discuss how:

  • The MC Resource Centers bring you the widest selection of white papers, trial software, and on-demand webcasts for you to choose from. >> Review the list of White Papers, Trial Software or On-Demand Webcast at the MC Press Resource Center. >> Add the items to yru Cart and complet he checkout process and submit

  • Profound Logic Have you been wondering about Node.js? Our free Node.js Webinar Series takes you from total beginner to creating a fully-functional IBM i Node.js business application.

  • SB Profound WC 5536Join us for this hour-long webcast that will explore:

  • Fortra IT managers hoping to find new IBM i talent are discovering that the pool of experienced RPG programmers and operators or administrators with intimate knowledge of the operating system and the applications that run on it is small. This begs the question: How will you manage the platform that supports such a big part of your business? This guide offers strategies and software suggestions to help you plan IT staffing and resources and smooth the transition after your AS/400 talent retires. Read on to learn: