import java.sql.*; public class staticSqlCall { public static void main(String[] args) throws SQLException { // Check the input parameters. if (args.length != 1) { System.out.println("Try again! Enter an 8-byte Customer Number"); return; } /*****************************************************************/ Connection con = null; String url = "jdbc:as400://Your IP address"; // Load the JDBC driver DriverManager.registerDriver(new com.ibm.as400.access.AS400JDBCDriver()); // Connect to the database System.out.println ("Connecting to AS/400..."); con = DriverManager.getConnection (url, "USERID", "PASSWORD"); /*****************************************************************/ CallableStatement sqlCall; sqlCall = con.prepareCall("CALL YourLib.CUSTFOUND(?,?)"); // Run an SQL SELECT statement sqlCall.setString(1, args[0]); //customer id sqlCall.registerOutParameter(2, java.sql.Types.SMALLINT); //found System.out.println ("Calling the RPG program..."); sqlCall.execute(); System.out.println ("Retrieving the out parms..."); boolean found = sqlCall.getBoolean(2); if (found) { System.out.println ("Customer " + args[0] + " is valid"); } else { System.out.println ("Customer " + args[0] + " is NOT valid"); } sqlCall.close(); con.close(); } }