IBM now includes the RUNSQLSTM command, shown in Figure 25.40, within the base operating system for i5 and iSeries. In earlier releases of the operating system, this command was provided through a licensed program product. Similar to the GUI Run SQL Scripts application discussed earlier in this chapter, this command executes the SQL statement stored in a source file on the i5 server. Use the editor of your choice to enter the statements.
If you are not using commitment control, be sure to change the commitment control parameter to *NONE when performing any database updates. Otherwise, the SQL updates will fail. The Naming parameter of *SYS indicates that file and library
The Source file and member reference a prewritten SQL statement, such as that shown in Figure 25.41.
The code in the MYSQLCMD source member actually includes two separate SQL statements. Just as with the Run SQL Script wizard, multiple SQL statements may be entered with a semi-
If this message is sent, see the job log for more information on the specific cause of the failure. The RUNSQLSTM command is a useful tool when you have a series of static SQL statements to execute. With no
SQL is a new and exciting frontier for many
i5 developers. If you have not already begun your journey into this
new world of database management, get started soon. As the demand
for web enablement and client integration
Chapter 26: JAVA on i5 and iSeries
Java is a relatively new language on the
iSeries. Many people talk about it, but few i5
What Is Java?
Java is a powerful new programming language resembling C++. In 1995, James Gosling of Sun Microsystems worked on a project to develop a language for programming smart home appliances. While doing so, he became frustrated with the C++ language and he decided to come up with something better. He removed all the things he did not like from C++, and the result was Java. Even though the project failed, Java found a home in programming for web browsers. It received a lot of media attention and its popularity quickly grew. What makes Java so popular? What gives Java its great potential?
The Java compiler does not create
machine-executable code. Rather, it creates Java Class objects
(programs) containing Java Byte Code. This symbolic form represents
a generic task with no specific instructions for performing that
task on any particular computer system. Each operating system that
supports Java has its own Java Virtual Machine (JVM). As
Procedural languages such as RPG and COBOL make up the majority of the traditional applications on the i5 platform. These languages focus on providing instructions to the computer. Object-oriented languages, such as Java, focus on creating structures that reflect the real-world behavior of whatever they model.
Modeling uses the class objects mentioned earlier.
Class objects represent a single real-world object. This could be
anything: a person, a document, or even a vehicle. Figure 26.2
One of the key differences between Java and C++, its predecessor, is that Java does not allow direct manipulation of memory pointers. Allowing programmers to work directly with pointers is both a powerful and dangerous technique. Java avoids pointers to make it safer and easier to use.
Another complex aspect of C++ that Java omits is polymorphism. In C++, polymorphism allows objects to inherit properties and methods from multiple parent objects. Managing this and resolving conflicts can be a challenge, so Java uses a simpler single inheritance model. Each class object may inherit properties and methods from only one parent class.
Memory management is challenge for most programmers. Applications often have "memory leaks," meaning that memory was allocated for some task and not released when the task was complete. Over time, this slows down the computer and eventually forces a reboot. Java assists programs deal with the unneeded objects through a process called garbage collection. Periodically, the JVM will identify unneeded classes and clean them up.