Rational Developer for Power Systems Software
V7.6

com.ibm.etools.iseries.comm
Class ISeriesSyntaxCheckSQLStatements

java.lang.Object
  extended by com.ibm.etools.iseries.comm.ISeriesAbstractHostAPIProcessor
      extended by com.ibm.etools.iseries.comm.ISeriesSyntaxCheckSQLStatements
All Implemented Interfaces:
IISeriesAPIProcessor

public class ISeriesSyntaxCheckSQLStatements
extends ISeriesAbstractHostAPIProcessor

A class for syntax checking the SQL Statements. This class uses the QSQCHKS OS/400 system api.

 The following example demonstrates the use of Syntax Check SQL Statements API: 
    try {
 
      //Syntax check SQL statment on the server called "Myserver"
      AS400 system = new AS400("Myserver");
      ISeriesSyntaxCheckSQLStatements syntaxCheck = 
                 new ISeriesSyntaxCheckSQLStatements(system);

      // SQL Statements to be syntax checked
      String SQLstmt[] = {"     C/EXEC SQL", 
                          "     C+ INSERT * FILE HAJI/KEYFILE",
                          "     C/END-EXEC"};
 
      // Length of each record 
      int stmtLen = 100;    

      // Specify the language  
      String language = "*RPGLE";
 
      // options - In this case the naming convention is set to the SQL naming convention
      syntaxCheck.setKeyOption(NAMING_CONVENTION, NAMING_CONVENTION_SQL);

      // Call the syntax checker   
      ISeriesSQLStatementHeader syntaxCheckResult = 
       (ISeriesSQLStatementHeader) syntaxCheck.syntaxCheckSQLStatements(SQLstmt, 
                                                                        stmtLen, 
                                                                        SQLstmt.length,
                                                                        language);
    } catch (Exception e1) {
        e1.printStackTrace();
    }
 


Nested Class Summary
 
Nested classes/interfaces inherited from class com.ibm.etools.iseries.comm.ISeriesAbstractHostAPIProcessor
ISeriesAbstractHostAPIProcessor.HostAPIErrorCodeStructure
 
Field Summary
protected  com.ibm.etools.iseries.comm.ISeriesSQLSyntaxCheckOptions _options
           
static String Copyright
           
 
Fields inherited from class com.ibm.etools.iseries.comm.ISeriesAbstractHostAPIProcessor
cancel, cancellableSubTasks, cancelQuerier, CREATE_FALSE, CREATE_TRUE, dbcsConvert, DEFAULT_OBJECT_FACTORY_BASIC, DEFAULT_OBJECT_FACTORY_BRIEF, DEFAULT_OBJECT_FACTORY_EXHAUSTIVE, DEFAULT_OBJECT_FACTORY_NAMEONLY, errorcodeObj, hostAPILibraries, INFOLEVEL_BASIC, INFOLEVEL_BRIEF, INFOLEVEL_EXHAUSTIVE, INFOLEVEL_NAME, INFOLEVEL_NAMEARRAY, INITIAL_SPACESIZE, LOG_DIR, LOG_FILENAME, logFile, logFileStream, logLineCounter, logStandardOut, NEED_USERSPACE_NO, NEED_USERSPACE_YES, objName, objType, QVDEOBJLinfo, returnObjectFactory, todos, tracePrefix, warnings
 
Constructor Summary
ISeriesSyntaxCheckSQLStatements()
          Constructor to use when you do not already have an AS400 object.
ISeriesSyntaxCheckSQLStatements(AS400 system)
          Constructor for ISeriesSyntaxCheckSQLStatements.
 
Method Summary
 void setKeyOption(int key, int value)
          Method to set the key options (int, int)
 void setKeyOption(int key, String value)
          Method to set the key options (int, String)
 IISeriesSQLStatementHeader syntaxCheckSQLStatements(String[] SQLStmt, int stmtLen, int numSQLStmts, String language)
          Syntax Check SQL Statements
 
Methods inherited from class com.ibm.etools.iseries.comm.ISeriesAbstractHostAPIProcessor
addCancellableSubTask, addWarning, cancel, clearWarnings, closeUserSpace, computeSize, createUserSpaceOnHost, determineInfoLevel, getClientCCSID, getDefaultObjectFactory, getErrorCodeStructure, getHostCCSID, getLibrary, getLogFileStream, getObjectFactory, getObjectName, getObjectType, getSystem, getUserSpace, getUserSpaceAPIName, getUserSpaceIFSName, getUserSpaceLibrary, getUserSpaceName, getWarnings, isCancelled, isTraceOn, logException, logHostMessages, logMessage, logMessage, logMessage, logTodo, openUserSpace, padString, parseBin8Date, parseChar13Date, parseChar7Date, parseChar8Date, readUserSpace, readUserSpace, registerCancelQuerier, removeCancellableSubTask, setClientCCSID, setHostCCSID, setLibrary, setLogFileDirectory, setObjectFactory, setObjectName, setObjectType, setSystem, setTracing, setUserSpaceLibrary, setUserSpaceName
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

Copyright

public static final String Copyright
See Also:
Constant Field Values

_options

protected com.ibm.etools.iseries.comm.ISeriesSQLSyntaxCheckOptions _options
Constructor Detail

ISeriesSyntaxCheckSQLStatements

public ISeriesSyntaxCheckSQLStatements()
Constructor to use when you do not already have an AS400 object. A new AS400 object will be created when getSQLSyntaxChecker is called, unless you subsequently call setSystem(AS400) first.


ISeriesSyntaxCheckSQLStatements

public ISeriesSyntaxCheckSQLStatements(AS400 system)
Constructor for ISeriesSyntaxCheckSQLStatements.

Method Detail

syntaxCheckSQLStatements

public IISeriesSQLStatementHeader syntaxCheckSQLStatements(String[] SQLStmt,
                                                           int stmtLen,
                                                           int numSQLStmts,
                                                           String language)
                                                    throws Exception
Syntax Check SQL Statements

Parameters:
SQLStmt[] - Source records containing SQL statements
stmtLen - Length of each record
numSQLStmts - Number of records to scan for the statement
language - The programming language for which the syntax check is to be performed
Returns:
The return statement information for all statements processed
Throws:
ISeriesAPIErrorCodeException - If the OS/400 api call returns an error code
Toolbox - exceptions if any errors occur while calling the api via the Toolbox's ProgramCall class
Exception

setKeyOption

public void setKeyOption(int key,
                         int value)
                  throws ISeriesInvalidAPIParameterException
Method to set the key options (int, int)

Parameters:
key - identifies a field of the options parameters
value - int containig the data to used for the specified key
Throws:
ISeriesInvalidAPIParameterException - If the parameter for the key options is invalid
See Also:
IISeriesSQLSyntaxOptionConstants

setKeyOption

public void setKeyOption(int key,
                         String value)
                  throws ISeriesInvalidAPIParameterException
Method to set the key options (int, String)

Parameters:
key - identifies a field of the options parameters
value - String containig the data to used for the specified key
Throws:
ISeriesInvalidAPIParameterException - If the parameter for the key options is invalid
See Also:
IISeriesSQLSyntaxOptionConstants

Rational Developer for Power Systems Software
V7.6

Copyright 2011 IBM Corp. All Rights Reserved.

Note: This documentation is for part of an interim API that is still under development and expected to change significantly before reaching stability. It is being made available at this early stage to solicit feedback from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken (repeatedly) as the API evolves.