public class SQLInteractionSpec
extends com.ibm.ims.db.cci.InteractionSpecImpl
SQLInteractionSpec
is used by an Interaction
to execute the specified SQL query against an IMS database.Constructor and Description |
---|
SQLInteractionSpec() |
Modifier and Type | Method and Description |
---|---|
int |
getFetchSize()
Retrieves the number of result set rows that is the default
fetch size for
ResultSet objects generated from this interaction. |
String |
getSQL()
Retrieves the SQL query the interaction will use when executed.
|
void |
setFetchSize(int rows)
Gives the JDBC driver a hint as to the number of rows that should
be fetched from the database when more rows are needed.
|
void |
setSQL(String query)
Sets the SQL query the interaction will use when executed.
|
getExecutionTimeout, getFetchDirection, getInteractionVerb, getMaxFieldSize, getResultSetConcurrency, getResultSetType, setExecutionTimeout, setFetchDirection, setInteractionVerb, setMaxFieldSize, setResultSetConcurrency, setResultSetType
public void setSQL(String query)
?
parameter marker, meaning that
the values will provided later (similar to a SELECT string for a PreparedStatement
in JDBC).
The following code example shows how to specify the SELECT statement without using
parameter markers, where SQLInteractionSpec
:
iSpec.setQuery("SELECT PATIENT.PATNAME, ILLNESS.ILLNAME "+ "FROM pcb01.HOSPITAL,pcb01.PATIENT, pcb01.ILLNESS " + "WHERE HOSPITAL.HOSPNAME='SANTA TERESA'");
The following example shows how to perform the SELECT statement with the parameter
markers, where SQLInteractionSpec
:
iSpec.setQuery("SELECT PATIENT.PatName, WARD.WardName "+ "FROM pcb01.HOSPITAL, pcb01.PATIENT, pcb01.WARD " + "WHERE HOSPITAL.HospName=? AND WARD.DocCount>?");
query
- a SQL querypublic String getSQL()
String
representing the SQL query.public void setFetchSize(int rows)
setFetchSize
in class com.ibm.ims.db.cci.InteractionSpecImpl
rows
- the number of rows to fetchpublic int getFetchSize()
ResultSet
objects generated from this interaction.getFetchSize
in class com.ibm.ims.db.cci.InteractionSpecImpl
(c) Copyright IBM Corporation 2008, 2017.