|
Rational Developer for Power Systems Software V7.6 |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.ibm.etools.iseries.comm.ISeriesAbstractHostAPIProcessor
com.ibm.etools.iseries.comm.ISeriesSyntaxCheckSQLStatements
public class ISeriesSyntaxCheckSQLStatements
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
|
| 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 java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final String Copyright
protected com.ibm.etools.iseries.comm.ISeriesSQLSyntaxCheckOptions _options
| Constructor Detail |
|---|
public ISeriesSyntaxCheckSQLStatements()
public ISeriesSyntaxCheckSQLStatements(AS400 system)
| Method Detail |
|---|
public IISeriesSQLStatementHeader syntaxCheckSQLStatements(String[] SQLStmt,
int stmtLen,
int numSQLStmts,
String language)
throws Exception
SQLStmt[] - Source records containing SQL statementsstmtLen - Length of each recordnumSQLStmts - Number of records to scan for the statementlanguage - The programming language for which the syntax check is to be performed
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
public void setKeyOption(int key,
int value)
throws ISeriesInvalidAPIParameterException
key - identifies a field of the options parametersvalue - int containig the data to used for the specified key
ISeriesInvalidAPIParameterException - If the parameter for the key options is invalidIISeriesSQLSyntaxOptionConstants
public void setKeyOption(int key,
String value)
throws ISeriesInvalidAPIParameterException
key - identifies a field of the options parametersvalue - String containig the data to used for the specified key
ISeriesInvalidAPIParameterException - If the parameter for the key options is invalidIISeriesSQLSyntaxOptionConstants
|
Rational Developer for Power Systems Software V7.6 |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||