|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.ibm.db.Statement
Statement is an abstract super class that represents an SQL statement.
SelectStatement
,
SQLStatement
,
CallableStatement
, Serialized FormConstructor Summary | |
Statement()
Constructs a new Statement. |
Method Summary | |
void |
addStatementAfterListener(StatementAfterListener listener)
Adds a listener to the StatementAfter event set. |
void |
addStatementBeforeListener(StatementBeforeListener listener)
Adds a listener to the StatementBefore event set. |
abstract void |
cancelExecution()
Cancels execution (in another thread) of the SQL statement associated with this Statement. |
abstract void |
execute()
Executes the SQL statement. |
DatabaseConnection |
getConnection()
Returns the DatabaseConnection associated with this Statement. |
StatementMetaData |
getMetaData()
Returns the StatementMetaData associated with the Statement. |
java.lang.Object |
getParameter(int parameterNumber)
Returns the value of the parameter at the specified index. |
java.lang.Object |
getParameter(java.lang.String parameterName)
Returns the value of the parameter with the specified name. |
java.lang.String |
getParameterToString(int parameterNumber)
Returns the value of the parameter at the specified index as a String. |
java.lang.String |
getParameterToString(java.lang.String parameterName)
Returns the value of the parameter with the specified name as a String. |
int |
getTimeout()
Returns the number of seconds the JDBC driver will wait for this statement to execute. |
boolean |
isExecuted()
Returns true if execute has been invoked for the Statement. |
boolean |
isReadOnly()
Returns true if updates are disallowed even when the database would permit them. |
boolean |
isValidateLOBs()
Returns true validates LOBs before they are returned from the cache. |
void |
removeStatementAfterListener(StatementAfterListener listener)
Removes a listener to the StatementAfter event set. |
void |
removeStatementBeforeListener(StatementBeforeListener listener)
Removes a listener to the StatementBefore event set. |
void |
setConnection(DatabaseConnection connection)
Associates a DatabaseConnection with the Statement. |
void |
setMetaData(StatementMetaData metaData)
Associates a StatementMetaData with the Statement. |
void |
setParameter(int parameterNumber,
java.lang.Object aValue)
Sets the parameter at the specified index to the specified value. |
void |
setParameter(java.lang.String parameterName,
java.lang.Object aValue)
Sets the parameter with the specified name to the specified value. |
void |
setParameterFromString(int parameterNumber,
java.lang.String stringValue)
Sets the parameter at the specified index to the specified value. |
void |
setParameterFromString(java.lang.String parameterName,
java.lang.String stringValue)
Sets the parameter with the specified name to the specified value. |
void |
setReadOnly(boolean aValue)
If true, updates are disallowed even when the database would permit them. |
void |
setTimeout(int seconds)
Sets the number of seconds the JDBC driver will wait for this statement to execute. |
void |
setValidateLOBs(boolean validateLOBs)
If true, validates LOBs before they are returned from the cache. |
Methods inherited from class java.lang.Object |
equals,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
Constructor Detail |
public Statement()
Method Detail |
public void addStatementAfterListener(StatementAfterListener listener)
execute
and
refresh
.listener
- StatementAfterListenerStatementAfterListener
,
removeStatementAfterListener(com.ibm.db.StatementAfterListener)
public void addStatementBeforeListener(StatementBeforeListener listener)
listener
- StatementBeforeListenerStatementBeforeListener
,
removeStatementBeforeListener(com.ibm.db.StatementBeforeListener)
public abstract void cancelExecution() throws DataException
public abstract void execute() throws DataException
public DatabaseConnection getConnection()
setConnection(com.ibm.db.DatabaseConnection)
public StatementMetaData getMetaData()
setMetaData(com.ibm.db.StatementMetaData)
public java.lang.Object getParameter(int parameterNumber) throws DataException
parameterNumber
- index of the parametergetParameterToString(int)
,
setParameter(int, java.lang.Object)
public java.lang.Object getParameter(java.lang.String parameterName) throws DataException
parameterName
- name of the parametergetParameterToString(int)
,
setParameter(int, java.lang.Object)
public java.lang.String getParameterToString(int parameterNumber) throws DataException
parameterNumber
- index of the parametergetParameter(int)
,
setParameterFromString(int, java.lang.String)
public java.lang.String getParameterToString(java.lang.String parameterName) throws DataException
parameterName
- name of the parametergetParameter(int)
,
setParameterFromString(int, java.lang.String)
public int getTimeout()
setTimeout(int)
public boolean isExecuted()
execute
has been invoked for the Statement.execute
has been invoked for the Statement,
otherwise false.public boolean isReadOnly()
setReadOnly(boolean)
public boolean isValidateLOBs()
setValidateLOBs(boolean)
public void removeStatementAfterListener(StatementAfterListener listener)
execute
and
refresh
.listener
- StatementAfterListenerStatementAfterListener
,
addStatementAfterListener(com.ibm.db.StatementAfterListener)
public void removeStatementBeforeListener(StatementBeforeListener listener)
execute
and refresh
.listener
- StatementBeforeListenerStatementBeforeListener
,
addStatementBeforeListener(com.ibm.db.StatementBeforeListener)
public void setConnection(DatabaseConnection connection)
connection
- the associated DatabaseConnectiongetConnection()
public void setMetaData(StatementMetaData metaData)
metaData
- the associated StatementMetaDatagetMetaData()
public void setParameter(int parameterNumber, java.lang.Object aValue) throws DataException
parameterNumber
- index of the parameteraValue
- parameter valuesetParameterFromString(int, java.lang.String)
,
getParameter(int)
public void setParameter(java.lang.String parameterName, java.lang.Object aValue) throws DataException
parameterName
- name of the parameteraValue
- parameter valuesetParameterFromString(int, java.lang.String)
,
getParameter(int)
public void setParameterFromString(int parameterNumber, java.lang.String stringValue) throws DataException
The stringValue is converted to the datatype associated with the parameter before the parameter is updated. To set a parameter value to null, pass null as the value. If the datatype is not String, you can also set a parameter value to null by passing a zero-length String as the value.
parameterNumber
- index of the parameterstringValue
- parameter value as a StringsetParameter(int, java.lang.Object)
,
getParameterToString(int)
public void setParameterFromString(java.lang.String parameterName, java.lang.String stringValue) throws DataException
The stringValue is converted to the datatype associated with the parameter before the parameter is updated. To set a parameter value to null, pass null as the value. If the datatype is not String, you can also set a parameter value to null by passing a zero-length String as the value.
parameterName
- name of the parameterstringValue
- parameter value as a StringsetParameter(int, java.lang.Object)
,
getParameterToString(int)
public void setReadOnly(boolean aValue)
aValue
- true if updates are disallowed;
false if updates are allowed.isReadOnly()
public void setTimeout(int seconds)
seconds
- the new timeout limit in seconds; zero means unlimitedgetTimeout()
public void setValidateLOBs(boolean validateLOBs)
isValidateLOBs()
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |