Java Doc for JdbcStatement.java in  » Database-DBMS » h2database » org » h2 » jdbc » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Database DBMS » h2database » org.h2.jdbc 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   org.h2.message.TraceObject
      org.h2.jdbc.JdbcStatement

All known Subclasses:   org.h2.jdbc.JdbcPreparedStatement,
JdbcStatement
public class JdbcStatement extends TraceObject implements Statement(Code)
Represents a statement.


Field Summary
protected  booleanclosedByResultSet
    
protected  JdbcConnectionconn
    
protected  booleanescapeProcessing
    
protected  intfetchSize
    
protected  intmaxRows
    
protected  JdbcResultSetresultSet
    
protected  intresultSetType
    
protected  SessionInterfacesession
    
protected  intupdateCount
    

Constructor Summary
 JdbcStatement(SessionInterface session, JdbcConnection conn, int resultSetType, int id, boolean closeWithResultSet)
    

Method Summary
public  voidaddBatch(String sql)
     Adds a statement to the batch.
public  voidcancel()
     [Partially supported] Cancels a currently running statement.
 voidcheckClosed()
    
public  voidclearBatch()
     Clears the batch.
public  voidclearWarnings()
     Clears all warnings.
public  voidclose()
     Closes this statement.
 voidcloseOld()
    
public  booleanexecute(String sql)
     Executes an arbitrary statement.
public  booleanexecute(String sql, int autoGeneratedKeys)
     Executes a statement and returns the update count.
public  booleanexecute(String sql, int[] columnIndexes)
     Executes a statement and returns the update count.
public  booleanexecute(String sql, String[] columnNames)
     Executes a statement and returns the update count.
public  int[]executeBatch()
     Executes the batch.
public  ResultSetexecuteQuery(String sql)
     Executes a query (select statement) and returns the result set.
public  intexecuteUpdate(String sql)
     Executes a statement (insert, update, delete, create, drop) and returns the update count.
public  intexecuteUpdate(String sql, int autoGeneratedKeys)
     Executes a statement and returns the update count.
public  intexecuteUpdate(String sql, int[] columnIndexes)
     Executes a statement and returns the update count.
public  intexecuteUpdate(String sql, String[] columnNames)
     Executes a statement and returns the update count.
public  ConnectiongetConnection()
     Returns the connection that created this object.
public  intgetFetchDirection()
     Gets the fetch direction.
public  intgetFetchSize()
     Gets the number of rows suggested to read in one step.
public  ResultSetgetGeneratedKeys()
     Return a result set that contains the last generated autoincrement key for this connection.
public  intgetMaxFieldSize()
     Gets the maximum number of bytes for a result set column.
public  intgetMaxRows()
     Gets the maximum number of rows for a ResultSet.
public  booleangetMoreResults()
     Moves to the next result set - however there is always only one result set.
public  booleangetMoreResults(int current)
    
public  intgetQueryTimeout()
     Gets the current query timeout in seconds.
public  ResultSetgetResultSet()
     Returns the last result set produces by this statement.
public  intgetResultSetConcurrency()
     Gets the result set concurrency created by this object.
public  intgetResultSetHoldability()
     Gets the result set holdability.
public  intgetResultSetType()
     Gets the result set type.
public  intgetUpdateCount()
     Returns the last update count of this statement.
public  SQLWarninggetWarnings()
     Gets the first warning reported by calls on this object.
public  booleanisClosed()
     Returns whether this statement is closed.
public  booleanisPoolable()
     Returns whether this object is poolable.
public  voidsetCursorName(String name)
     Sets the name of the cursor.
public  voidsetEscapeProcessing(boolean enable)
     Enables or disables processing or JDBC escape syntax.
protected  voidsetExecutingStatement(CommandInterface c)
    
public  voidsetFetchDirection(int direction)
     Sets the fetch direction.
public  voidsetFetchSize(int rows)
     Sets the number of rows suggested to read in one step. This value cannot be higher than the maximum rows (setMaxRows) set by the statement or prepared statement, otherwise an exception is throws.
public  voidsetMaxFieldSize(int max)
     Sets the maximum number of bytes for a result set column.
public  voidsetMaxRows(int maxRows)
     Gets the maximum number of rows for a ResultSet.
public  voidsetPoolable(boolean poolable)
     Requests that this object should be pooled or not.
public  voidsetQueryTimeout(int seconds)
     Sets the current query timeout in seconds.
public  StringtoString()
    

Field Detail
closedByResultSet
protected boolean closedByResultSet(Code)



conn
protected JdbcConnection conn(Code)



escapeProcessing
protected boolean escapeProcessing(Code)



fetchSize
protected int fetchSize(Code)



maxRows
protected int maxRows(Code)



resultSet
protected JdbcResultSet resultSet(Code)



resultSetType
protected int resultSetType(Code)



session
protected SessionInterface session(Code)



updateCount
protected int updateCount(Code)




Constructor Detail
JdbcStatement
JdbcStatement(SessionInterface session, JdbcConnection conn, int resultSetType, int id, boolean closeWithResultSet)(Code)




Method Detail
addBatch
public void addBatch(String sql) throws SQLException(Code)
Adds a statement to the batch.



cancel
public void cancel() throws SQLException(Code)
[Partially supported] Cancels a currently running statement. This method must be called from within another thread than the execute method. This method is not supported in the server mode.
throws:
  SQLException - if this object is closed



checkClosed
void checkClosed() throws SQLException(Code)



clearBatch
public void clearBatch() throws SQLException(Code)
Clears the batch.



clearWarnings
public void clearWarnings() throws SQLException(Code)
Clears all warnings. As this driver does not support warnings, this call is ignored.



close
public void close() throws SQLException(Code)
Closes this statement. All result sets that where created by this statement become invalid after calling this method.



closeOld
void closeOld() throws SQLException(Code)



execute
public boolean execute(String sql) throws SQLException(Code)
Executes an arbitrary statement. If another result set exists for this statement, this will be closed (even if this statement fails). If the statement is a create or drop and does not throw an exception, the current transaction (if any) is committed after executing the statement. If auto commit is on, and the statement is not a select, this statement will be committed. true if a result set is available, false if not



execute
public boolean execute(String sql, int autoGeneratedKeys) throws SQLException(Code)
Executes a statement and returns the update count. This method just calls execute(String sql).
Parameters:
  sql - the SQL statement the update count (number of row affected by an insert,update or delete, or 0 if no rows or the statement was acreate, drop, commit or rollback)
throws:
  SQLException - if a database error occurred or aselect statement was executed



execute
public boolean execute(String sql, int[] columnIndexes) throws SQLException(Code)
Executes a statement and returns the update count. This method just calls execute(String sql).
Parameters:
  sql - the SQL statement the update count (number of row affected by an insert,update or delete, or 0 if no rows or the statement was acreate, drop, commit or rollback)
throws:
  SQLException - if a database error occurred or aselect statement was executed



execute
public boolean execute(String sql, String[] columnNames) throws SQLException(Code)
Executes a statement and returns the update count. This method just calls execute(String sql).
Parameters:
  sql - the SQL statement the update count (number of row affected by an insert,update or delete, or 0 if no rows or the statement was acreate, drop, commit or rollback)
throws:
  SQLException - if a database error occurred or aselect statement was executed



executeBatch
public int[] executeBatch() throws SQLException(Code)
Executes the batch. the array of update counts



executeQuery
public ResultSet executeQuery(String sql) throws SQLException(Code)
Executes a query (select statement) and returns the result set. If another result set exists for this statement, this will be closed (even if this statement fails). the result set



executeUpdate
public int executeUpdate(String sql) throws SQLException(Code)
Executes a statement (insert, update, delete, create, drop) and returns the update count. If another result set exists for this statement, this will be closed (even if this statement fails). If the statement is a create or drop and does not throw an exception, the current transaction (if any) is committed after executing the statement. If auto commit is on, this statement will be committed.
Parameters:
  sql - the SQL statement the update count (number of row affected by an insert,update or delete, or 0 if no rows or the statement was acreate, drop, commit or rollback)
throws:
  SQLException - if a database error occurred or aselect statement was executed



executeUpdate
public int executeUpdate(String sql, int autoGeneratedKeys) throws SQLException(Code)
Executes a statement and returns the update count. This method just calls executeUpdate(String sql).
Parameters:
  sql - the SQL statement the update count (number of row affected by an insert,update or delete, or 0 if no rows or the statement was acreate, drop, commit or rollback)
throws:
  SQLException - if a database error occurred or aselect statement was executed



executeUpdate
public int executeUpdate(String sql, int[] columnIndexes) throws SQLException(Code)
Executes a statement and returns the update count. This method just calls executeUpdate(String sql).
Parameters:
  sql - the SQL statement the update count (number of row affected by an insert,update or delete, or 0 if no rows or the statement was acreate, drop, commit or rollback)
throws:
  SQLException - if a database error occurred or aselect statement was executed



executeUpdate
public int executeUpdate(String sql, String[] columnNames) throws SQLException(Code)
Executes a statement and returns the update count. This method just calls executeUpdate(String sql).
Parameters:
  sql - the SQL statement the update count (number of row affected by an insert,update or delete, or 0 if no rows or the statement was acreate, drop, commit or rollback)
throws:
  SQLException - if a database error occurred or aselect statement was executed



getConnection
public Connection getConnection() throws SQLException(Code)
Returns the connection that created this object. the connection



getFetchDirection
public int getFetchDirection() throws SQLException(Code)
Gets the fetch direction. FETCH_FORWARD
throws:
  SQLException - if this object is closed



getFetchSize
public int getFetchSize() throws SQLException(Code)
Gets the number of rows suggested to read in one step. the current fetch size
throws:
  SQLException - if this object is closed



getGeneratedKeys
public ResultSet getGeneratedKeys() throws SQLException(Code)
Return a result set that contains the last generated autoincrement key for this connection. the result set with one row and one column containing the key
throws:
  SQLException - if this object is closed



getMaxFieldSize
public int getMaxFieldSize() throws SQLException(Code)
Gets the maximum number of bytes for a result set column. always 0 for no limit
throws:
  SQLException - if this object is closed



getMaxRows
public int getMaxRows() throws SQLException(Code)
Gets the maximum number of rows for a ResultSet. the number of rows where 0 means no limit
throws:
  SQLException - if this object is closed



getMoreResults
public boolean getMoreResults() throws SQLException(Code)
Moves to the next result set - however there is always only one result set. This call also closes the current result set (if there is one). Returns true if there is a next result set (that means - it always returns false). false
throws:
  SQLException - if this object is closed.



getMoreResults
public boolean getMoreResults(int current) throws SQLException(Code)
[Not supported]



getQueryTimeout
public int getQueryTimeout() throws SQLException(Code)
Gets the current query timeout in seconds. This method will return 0 if no query timeout is set. The result is rounded to the next second. the timeout in seconds
throws:
  SQLException - if this object is closed



getResultSet
public ResultSet getResultSet() throws SQLException(Code)
Returns the last result set produces by this statement. the result set



getResultSetConcurrency
public int getResultSetConcurrency() throws SQLException(Code)
Gets the result set concurrency created by this object. ResultSet.CONCUR_UPDATABLE
throws:
  SQLException - if this object is closed



getResultSetHoldability
public int getResultSetHoldability() throws SQLException(Code)
Gets the result set holdability. the holdability



getResultSetType
public int getResultSetType() throws SQLException(Code)
Gets the result set type. the type
throws:
  SQLException - if this object is closed



getUpdateCount
public int getUpdateCount() throws SQLException(Code)
Returns the last update count of this statement. the update count (number of row affected by an insert,update or delete, or 0 if no rows or the statement was acreate, drop, commit or rollback; -1 if the statement was a select).
throws:
  SQLException - if this object is closed or invalid



getWarnings
public SQLWarning getWarnings() throws SQLException(Code)
Gets the first warning reported by calls on this object. This driver does not support warnings, and will always return null. null



isClosed
public boolean isClosed() throws SQLException(Code)
Returns whether this statement is closed. true if the statement is closed



isPoolable
public boolean isPoolable() throws SQLException(Code)
Returns whether this object is poolable. false



setCursorName
public void setCursorName(String name) throws SQLException(Code)
Sets the name of the cursor. This call is ignored.
Parameters:
  name - ignored
throws:
  SQLException - if this object is closed



setEscapeProcessing
public void setEscapeProcessing(boolean enable) throws SQLException(Code)
Enables or disables processing or JDBC escape syntax. See also Connection.nativeSQL.
Parameters:
  enable - - true (default) or false (no conversion is attempted)
throws:
  SQLException - if this object is closed



setExecutingStatement
protected void setExecutingStatement(CommandInterface c)(Code)



setFetchDirection
public void setFetchDirection(int direction) throws SQLException(Code)
Sets the fetch direction. This call is ignored by this driver.
Parameters:
  direction - ignored
throws:
  SQLException - if this object is closed



setFetchSize
public void setFetchSize(int rows) throws SQLException(Code)
Sets the number of rows suggested to read in one step. This value cannot be higher than the maximum rows (setMaxRows) set by the statement or prepared statement, otherwise an exception is throws. Setting the value to 0 will set the default value. The default value can be changed using the system property h2.serverResultSetFetchSize.
Parameters:
  rows - the number of rows
throws:
  SQLException - if this object is closed



setMaxFieldSize
public void setMaxFieldSize(int max) throws SQLException(Code)
Sets the maximum number of bytes for a result set column. This method does currently do nothing for this driver.
Parameters:
  max - the maximum size - ignored
throws:
  SQLException - if this object is closed



setMaxRows
public void setMaxRows(int maxRows) throws SQLException(Code)
Gets the maximum number of rows for a ResultSet.
Parameters:
  maxRows - the number of rows where 0 means no limit
throws:
  SQLException - if this object is closed



setPoolable
public void setPoolable(boolean poolable) throws SQLException(Code)
Requests that this object should be pooled or not. This call is ignored.
Parameters:
  poolable - the requested value



setQueryTimeout
public void setQueryTimeout(int seconds) throws SQLException(Code)
Sets the current query timeout in seconds. Calling this method will commit an open transaction, even if the value is the same as before. Changing the value will affect all statements of this connection.
Parameters:
  seconds - the timeout in seconds - 0 means no timeout, valuessmaller 0 will throw an exception
throws:
  SQLException - if this object is closed



toString
public String toString()(Code)
INTERNAL



Fields inherited from org.h2.message.TraceObject
final public static int CALLABLE_STATEMENTCONNECTIONDATABASE_META_DATAPREPARED_STATEMENTRESULT_SETRESULT_SET_META_DATASAVEPOINTSQL_EXCEPTIONSTATEMENTBLOBCLOBPARAMETER_META_DATA(Code)(Java Doc)
final public static int DATA_SOURCEXA_DATA_SOURCEXIDARRAY(Code)(Java Doc)

Methods inherited from org.h2.message.TraceObject
protected boolean debug()(Code)(Java Doc)
protected void debugCode(String text)(Code)(Java Doc)
protected void debugCodeAssign(String className, int type, int id, String value)(Code)(Java Doc)
protected void debugCodeCall(String text)(Code)(Java Doc)
protected void debugCodeCall(String text, long param)(Code)(Java Doc)
protected void debugCodeCall(String text, String param)(Code)(Java Doc)
protected int getNextId(int type)(Code)(Java Doc)
protected Trace getTrace()(Code)(Java Doc)
protected int getTraceId()(Code)(Java Doc)
public String getTraceObjectName()(Code)(Java Doc)
protected boolean info()(Code)(Java Doc)
protected SQLException logAndConvert(Throwable e)(Code)(Java Doc)
protected String quote(String s)(Code)(Java Doc)
protected String quoteArray(String[] s)(Code)(Java Doc)
protected String quoteBigDecimal(BigDecimal x)(Code)(Java Doc)
protected String quoteBytes(byte[] x)(Code)(Java Doc)
protected String quoteDate(java.sql.Date x)(Code)(Java Doc)
protected String quoteIntArray(int[] s)(Code)(Java Doc)
protected String quoteMap(Map map)(Code)(Java Doc)
protected String quoteTime(java.sql.Time x)(Code)(Java Doc)
protected String quoteTimestamp(java.sql.Timestamp x)(Code)(Java Doc)
protected void setTrace(Trace trace, int type, int id)(Code)(Java Doc)
public static String toString(String sql, ObjectArray params)(Code)(Java Doc)

Methods inherited from java.lang.Object
native protected Object clone() throws CloneNotSupportedException(Code)(Java Doc)
public boolean equals(Object obj)(Code)(Java Doc)
protected void finalize() throws Throwable(Code)(Java Doc)
final native public Class getClass()(Code)(Java Doc)
native public int hashCode()(Code)(Java Doc)
final native public void notify()(Code)(Java Doc)
final native public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final native public void wait(long timeout) throws InterruptedException(Code)(Java Doc)
final public void wait(long timeout, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait() throws InterruptedException(Code)(Java Doc)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.