|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.ibm.as400.micro.JdbcMeStatement
public class JdbcMeStatement extends Object implements Statement
The AS400JDBCStatement class provides a mechanism for executing static SQL statements. Use Connection.createStatement() to create new Statement objects.
Only one result set per statement can be open at any point in time. Therefore, if an application needs to read from multiple result sets, then each must be generated by a different statement.
Note: Since Java 2 Micro-Edition does not include java.sql, JdbcMeStatement implements the java.sql package that is also part of this driver.
Modifier and Type | Field and Description |
---|
Fields inherited from interface java.sql.Statement |
---|
CLOSE_ALL_RESULTS, CLOSE_CURRENT_RESULT, EXECUTE_FAILED, KEEP_CURRENT_RESULT, NO_GENERATED_KEYS, RETURN_GENERATED_KEYS, SUCCESS_NO_INFO |
Modifier and Type | Method and Description |
---|---|
void |
close()
Releases the statement's resources. |
boolean |
execute(String sql)
Runs an SQL statement that may return multiple result sets. |
ResultSet |
executeQuery(String sql)
Runs an SQL statement that returns a single result set. |
boolean |
executeToOfflineData(String sql,
String dbName,
int dbCreator,
int dbType)
Create or overwrite an offline device specific database containing the results of the query specified. |
int |
executeUpdate(String sql)
Runs an SQL INSERT, UPDATE, or DELETE statement, or any SQL statement that does not return a result set. |
Connection |
getConnection()
Returns the connection for this statement. |
ResultSet |
getResultSet()
Returns the current result set. |
int |
getResultSetConcurrency()
Returns the result set concurrency to be used for this statement. |
int |
getResultSetType()
Returns the result set type to be used for this statement. |
int |
getUpdateCount()
Returns the current update count. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface java.sql.Statement |
---|
addBatch, cancel, clearBatch, clearWarnings, execute, execute, execute, executeBatch, executeUpdate, executeUpdate, executeUpdate, getFetchDirection, getFetchSize, getGeneratedKeys, getMaxFieldSize, getMaxRows, getMoreResults, getMoreResults, getQueryTimeout, getResultSetHoldability, getWarnings, isClosed, isPoolable, setCursorName, setEscapeProcessing, setFetchDirection, setFetchSize, setMaxFieldSize, setMaxRows, setPoolable, setQueryTimeout |
Methods inherited from interface java.sql.Wrapper |
---|
isWrapperFor, unwrap |
Method Detail |
---|
public void close() throws JdbcMeException
close
in interface Statement
JdbcMeException
- If an error occurs.public ResultSet executeQuery(String sql) throws JdbcMeException
executeQuery
in interface Statement
sql
- The SQL statement.JdbcMeException
- If the statement is not open,
the SQL statement contains a syntax
error, no result set is returned by the
database, the query timeout limit is
exceeded, or an error occurs.public int executeUpdate(String sql) throws JdbcMeException
executeUpdate
in interface Statement
sql
- The SQL statement.JdbcMeException
- If the statement is not open,
the SQL statement contains a syntax
error, the query timeout limit is
exceeded, the statement returns
a result set, or an error occurs.public boolean execute(String sql) throws JdbcMeException
Under some situations, a single SQL statement may return multiple result sets, an update count, or both. This might occur when executing a stored procedure that returns multiple result sets or when dynamically executing an unknown SQL string.
Use getResultSet() and getUpdateCount() to navigate through multiple result sets, an update count, or both.
execute
in interface Statement
sql
- The SQL statement.JdbcMeException
- If the statement is not open,
the SQL statement contains a syntax
error, the query timeout limit is
exceeded, or an error occurs.public boolean executeToOfflineData(String sql, String dbName, int dbCreator, int dbType) throws JdbcMeException
If the SQL statement does not generate query results, then the target offline database is not changed.
If the target offline database exists, it is destroyed and its contents are filled with the results of the query.
Use JdbcMeOfflineResultSet to access the data from the offline data at a later time (for example after disconnecting from the DB server.
For example. MIDP - The 'name' is a unique string of up to 32 unique characters identifying a javax.microedition.rms.RecordStore object the offline data object returned, then encapsulates the RecordStore object. PALM - The 'name' is effectively just a visual key, while the offline data is uniquely identified by the 'dbCreator' and the 'dbType' parameters.
sql
- The SQL statement.dbName
- The name of the offline database.dbCreator
- The unique offline database creator identifier.dbType
- The unique offline database type identifier.JdbcMeException
- If the statement is not open,
the SQL statement contains a syntax
error, the query timeout limit is
exceeded, or an error occurs.public ResultSet getResultSet() throws JdbcMeException
getResultSet
in interface Statement
JdbcMeException
- If the statement is not open.public int getResultSetConcurrency() throws JdbcMeException
getResultSetConcurrency
in interface Statement
JdbcMeException
- If the statement is not open.public int getResultSetType() throws JdbcMeException
getResultSetType
in interface Statement
JdbcMeException
- If the statement is not open.public int getUpdateCount() throws JdbcMeException
getUpdateCount
in interface Statement
JdbcMeException
- If the statement is not open.public Connection getConnection() throws JdbcMeException
getConnection
in interface Statement
JdbcMeException
- If an error occurs.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |