Java Doc for BrokeredStatement.java in  » Database-DBMS » db-derby-10.2 » org » apache » derby » iapi » 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 » db derby 10.2 » org.apache.derby.iapi.jdbc 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   org.apache.derby.iapi.jdbc.BrokeredStatement

All known Subclasses:   org.apache.derby.iapi.jdbc.BrokeredStatement40,  org.apache.derby.iapi.jdbc.BrokeredPreparedStatement,
BrokeredStatement
public class BrokeredStatement implements EngineStatement(Code)
A Statement implementation that forwards all of its requests to an underlying Statement.


Field Summary
final  BrokeredStatementControlcontrol
     My control.
final  intjdbcLevel
    
final  intresultSetConcurrency
    
final  intresultSetHoldability
    
final  intresultSetType
    

Constructor Summary
 BrokeredStatement(BrokeredStatementControl control, int jdbcLevel)
    

Method Summary
final public  voidaddBatch(String sql)
    
final public  voidcancel()
    
final protected  voidcheckIfClosed()
     Checks if the statement is closed and throws an exception if it is.
final public  voidclearBatch()
    
final public  voidclearWarnings()
     After this call getWarnings returns null until a new warning is reported for this Statement.
final public  voidclose()
     In many cases, it is desirable to immediately release a Statements's database and JDBC resources instead of waiting for this to happen when it is automatically closed; the close method provides this immediate release.

Note: A Statement is automatically closed when it is garbage collected.

final  BrokeredStatementControlcontrolCheck()
     Get the BrokeredStatementControl in order to perform a check.
public  StatementcreateDuplicateStatement(Connection conn, Statement oldStatement)
    
final public  booleanexecute(String sql)
    
final public  booleanexecute(String sql, int autoGeneratedKeys)
    
final public  booleanexecute(String sql, int[] columnIndexes)
    
final public  booleanexecute(String sql, String[] columnNames)
    
final public  int[]executeBatch()
    
final public  ResultSetexecuteQuery(String sql)
    
final public  intexecuteUpdate(String sql)
    
final public  intexecuteUpdate(String sql, int autoGeneratedKeys)
    
final public  intexecuteUpdate(String sql, int[] columnIndexes)
    
final public  intexecuteUpdate(String sql, String[] columnNames)
    
final public  ConnectiongetConnection()
    
final public  intgetFetchDirection()
    
final public  intgetFetchSize()
    
final public  ResultSetgetGeneratedKeys()
     JDBC 3.0 Retrieves any auto-generated keys created as a result of executing this Statement object.
final public  intgetMaxFieldSize()
    
final public  intgetMaxRows()
    
final public  booleangetMoreResults()
     getMoreResults moves to a Statement's next result.
final public  booleangetMoreResults(int current)
    
final public  intgetQueryTimeout()
    
final public  ResultSetgetResultSet()
     getResultSet returns the current result as a ResultSet.
final public  intgetResultSetConcurrency()
    
final public  intgetResultSetHoldability()
     Return the holdability of ResultSets created by this Statement. If this Statement is active in a global transaction the CLOSE_CURSORS_ON_COMMIT will be returned regardless of the holdability it was created with.
final public  intgetResultSetType()
     JDBC 2.0 Determine the result set type.
public  StatementgetStatement()
    
final public  intgetUpdateCount()
     getUpdateCount returns the current result as an update count; if the result is a ResultSet or there are no more results -1 is returned.
final public  SQLWarninggetWarnings()
     The first warning reported by calls on this Statement is returned.
protected  booleanisClosed()
     Checks if the statement is closed.
public  booleanisWrapperFor(Class iface)
     Returns false unless iface is implemented
Parameters:
  iface - a Class defining an interface.
final public  voidsetCursorName(String name)
     setCursorName defines the SQL cursor name that will be used by subsequent Statement execute methods.
final public  voidsetEscapeProcessing(boolean enable)
     If escape scanning is on (the default) the driver will do escape substitution before sending the SQL to the database.
final public  voidsetFetchDirection(int direction)
     JDBC 2.0 Give a hint as to the direction in which the rows in a result set will be processed.
final public  voidsetFetchSize(int rows)
     JDBC 2.0 Give the JDBC driver a hint as to the number of rows that should be fetched from the database when more rows are needed.
final public  voidsetMaxFieldSize(int max)
     The maxFieldSize limit (in bytes) is set to limit the size of data that can be returned for any column value; it only applies to BINARY, VARBINARY, LONGVARBINARY, CHAR, VARCHAR, and LONGVARCHAR fields.
final public  voidsetMaxRows(int max)
     The maxRows limit is set to limit the number of rows that any ResultSet can contain.
final public  voidsetQueryTimeout(int seconds)
    
 voidsetStatementState(Statement oldStatement, Statement newStatement)
    
final  ResultSetwrapResultSet(ResultSet rs)
     Provide the control access to every ResultSet we return.

Field Detail
control
final BrokeredStatementControl control(Code)
My control. Use the controlCheck() method to obtain the control when calling a check method. This will result in the correct exception being thrown if the statement is already closed.



jdbcLevel
final int jdbcLevel(Code)



resultSetConcurrency
final int resultSetConcurrency(Code)



resultSetHoldability
final int resultSetHoldability(Code)



resultSetType
final int resultSetType(Code)




Constructor Detail
BrokeredStatement
BrokeredStatement(BrokeredStatementControl control, int jdbcLevel) throws SQLException(Code)




Method Detail
addBatch
final public void addBatch(String sql) throws SQLException(Code)



cancel
final public void cancel() throws SQLException(Code)



checkIfClosed
final protected void checkIfClosed() throws SQLException(Code)
Checks if the statement is closed and throws an exception if it is. This method relies on the isClosed() method and therefore only works with JDBC 4.0.
exception:
  SQLException - if the statement is closed



clearBatch
final public void clearBatch() throws SQLException(Code)



clearWarnings
final public void clearWarnings() throws SQLException(Code)
After this call getWarnings returns null until a new warning is reported for this Statement.
exception:
  SQLException - thrown on failure.



close
final public void close() throws SQLException(Code)
In many cases, it is desirable to immediately release a Statements's database and JDBC resources instead of waiting for this to happen when it is automatically closed; the close method provides this immediate release.

Note: A Statement is automatically closed when it is garbage collected. When a Statement is closed its current ResultSet, if one exists, is also closed.
exception:
  SQLException - thrown on failure.




controlCheck
final BrokeredStatementControl controlCheck() throws SQLException(Code)
Get the BrokeredStatementControl in order to perform a check. Obtained indirectly to ensure that the correct exception is thrown if the Statement has been closed.



createDuplicateStatement
public Statement createDuplicateStatement(Connection conn, Statement oldStatement) throws SQLException(Code)



execute
final public boolean execute(String sql) throws SQLException(Code)



execute
final public boolean execute(String sql, int autoGeneratedKeys) throws SQLException(Code)



execute
final public boolean execute(String sql, int[] columnIndexes) throws SQLException(Code)



execute
final public boolean execute(String sql, String[] columnNames) throws SQLException(Code)



executeBatch
final public int[] executeBatch() throws SQLException(Code)



executeQuery
final public ResultSet executeQuery(String sql) throws SQLException(Code)



executeUpdate
final public int executeUpdate(String sql) throws SQLException(Code)



executeUpdate
final public int executeUpdate(String sql, int autoGeneratedKeys) throws SQLException(Code)



executeUpdate
final public int executeUpdate(String sql, int[] columnIndexes) throws SQLException(Code)



executeUpdate
final public int executeUpdate(String sql, String[] columnNames) throws SQLException(Code)



getConnection
final public Connection getConnection() throws SQLException(Code)



getFetchDirection
final public int getFetchDirection() throws SQLException(Code)



getFetchSize
final public int getFetchSize() throws SQLException(Code)



getGeneratedKeys
final public ResultSet getGeneratedKeys() throws SQLException(Code)
JDBC 3.0 Retrieves any auto-generated keys created as a result of executing this Statement object. If this Statement object did not generate any keys, an empty ResultSet object is returned. If this Statement is a non-insert statement, an exception will be thrown. a ResultSet object containing the auto-generated key(s) generated bythe execution of this Statement object
exception:
  SQLException - if a database access error occurs



getMaxFieldSize
final public int getMaxFieldSize() throws SQLException(Code)



getMaxRows
final public int getMaxRows() throws SQLException(Code)



getMoreResults
final public boolean getMoreResults() throws SQLException(Code)
getMoreResults moves to a Statement's next result. It returns true if this result is a ResultSet. getMoreResults also implicitly closes any current ResultSet obtained with getResultSet. There are no more results when (!getMoreResults() && (getUpdateCount() == -1) true if the next result is a ResultSet; false if it isan update count or there are no more results
See Also:   BrokeredStatement.execute
exception:
  SQLException - thrown on failure.



getMoreResults
final public boolean getMoreResults(int current) throws SQLException(Code)
JDBC 3.0 Moves to this Statement obect's next result, deals with any current ResultSet object(s) according to the instructions specified by the given flag, and returns true if the next result is a ResultSet object
Parameters:
  current - - one of the following Statement constants indicating whatshould happen to current ResultSet objects obtained using the methodgetResultSetCLOSE_CURRENT_RESULT, KEEP_CURRENT_RESULT, or CLOSE_ALL_RESULTS true if the next result is a ResultSet; false if it isan update count or there are no more results
See Also:   BrokeredStatement.execute
exception:
  SQLException - thrown on failure.



getQueryTimeout
final public int getQueryTimeout() throws SQLException(Code)



getResultSet
final public ResultSet getResultSet() throws SQLException(Code)
getResultSet returns the current result as a ResultSet. It should only be called once per result. the current result as a ResultSet; null if the resultis an update count or there are no more results or the statementwas closed.
See Also:   BrokeredStatement.execute



getResultSetConcurrency
final public int getResultSetConcurrency() throws SQLException(Code)



getResultSetHoldability
final public int getResultSetHoldability() throws SQLException(Code)
Return the holdability of ResultSets created by this Statement. If this Statement is active in a global transaction the CLOSE_CURSORS_ON_COMMIT will be returned regardless of the holdability it was created with. In a local transaction the original create holdabilty will be returned.



getResultSetType
final public int getResultSetType() throws SQLException(Code)
JDBC 2.0 Determine the result set type.
exception:
  SQLException - Feature not implemented for now.



getStatement
public Statement getStatement() throws SQLException(Code)



getUpdateCount
final public int getUpdateCount() throws SQLException(Code)
getUpdateCount returns the current result as an update count; if the result is a ResultSet or there are no more results -1 is returned. It should only be called once per result.

The only way to tell for sure that the result is an update count is to first test to see if it is a ResultSet. If it is not a ResultSet it is either an update count or there are no more results. the current result as an update count; -1 if it is aResultSet or there are no more results
See Also:   BrokeredStatement.execute




getWarnings
final public SQLWarning getWarnings() throws SQLException(Code)
The first warning reported by calls on this Statement is returned. A Statment's execute methods clear its SQLWarning chain. Subsequent Statement warnings will be chained to this SQLWarning.

The warning chain is automatically cleared each time a statement is (re)executed.

Note: If you are processing a ResultSet then any warnings associated with ResultSet reads will be chained on the ResultSet object. the first SQLWarning or null
exception:
  SQLException - thrown on failure.




isClosed
protected boolean isClosed() throws SQLException(Code)
Checks if the statement is closed. Not implemented for this class since isClosed() is a new method in JDBC 4.0. The JDBC 4.0 sub-classes should override this method. true if the statement is closed,false otherwise
exception:
  SQLException - not-implemented exception



isWrapperFor
public boolean isWrapperFor(Class iface) throws SQLException(Code)
Returns false unless iface is implemented
Parameters:
  iface - a Class defining an interface. true if this implements the interface or directly or indirectly wraps an object that does.
throws:
  java.sql.SQLException - if an error occurs while determining whether this is a wrapper for an object with the given interface.



setCursorName
final public void setCursorName(String name) throws SQLException(Code)
setCursorName defines the SQL cursor name that will be used by subsequent Statement execute methods. This name can then be used in SQL positioned update/delete statements to identify the current row in the ResultSet generated by this getStatement(). If the database doesn't support positioned update/delete, this method is a noop.

Note: By definition, positioned update/delete execution must be done by a different Statement than the one which generated the ResultSet being used for positioning. Also, cursor names must be unique within a Connection.
Parameters:
  name - the new cursor name.




setEscapeProcessing
final public void setEscapeProcessing(boolean enable) throws SQLException(Code)
If escape scanning is on (the default) the driver will do escape substitution before sending the SQL to the database.
Parameters:
  enable - true to enable; false to disable
exception:
  SQLException - thrown on failure.



setFetchDirection
final public void setFetchDirection(int direction) throws SQLException(Code)
JDBC 2.0 Give a hint as to the direction in which the rows in a result set will be processed. The hint applies only to result sets created using this Statement object. The default value is ResultSet.FETCH_FORWARD.
Parameters:
  direction - the initial direction for processing rows
exception:
  SQLException - if a database-access error occurs or directionis not one of ResultSet.FETCH_FORWARD, ResultSet.FETCH_REVERSE, orResultSet.FETCH_UNKNOWN



setFetchSize
final public void setFetchSize(int rows) throws SQLException(Code)
JDBC 2.0 Give the JDBC driver a hint as to the number of rows that should be fetched from the database when more rows are needed. The number of rows specified only affects result sets created using this getStatement(). If the value specified is zero, then the hint is ignored. The default value is zero.
Parameters:
  rows - the number of rows to fetch
exception:
  SQLException - if a database-access error occurs, or thecondition 0 <= rows <= this.getMaxRows() is not satisfied.



setMaxFieldSize
final public void setMaxFieldSize(int max) throws SQLException(Code)
The maxFieldSize limit (in bytes) is set to limit the size of data that can be returned for any column value; it only applies to BINARY, VARBINARY, LONGVARBINARY, CHAR, VARCHAR, and LONGVARCHAR fields. If the limit is exceeded, the excess data is silently discarded.
Parameters:
  max - the new max column size limit; zero means unlimited
exception:
  SQLException - thrown on failure.



setMaxRows
final public void setMaxRows(int max) throws SQLException(Code)
The maxRows limit is set to limit the number of rows that any ResultSet can contain. If the limit is exceeded, the excess rows are silently dropped.
Parameters:
  max - the new max rows limit; zero means unlimited
exception:
  SQLException - thrown on failure.



setQueryTimeout
final public void setQueryTimeout(int seconds) throws SQLException(Code)



setStatementState
void setStatementState(Statement oldStatement, Statement newStatement) throws SQLException(Code)



wrapResultSet
final ResultSet wrapResultSet(ResultSet rs)(Code)
Provide the control access to every ResultSet we return. If required the control can wrap the ResultSet, but it (the control) must ensure a underlying ResultSet is only wrapped once, if say java.sql.Statement.getResultSet is returned twice.
Parameters:
  rs - ResultSet being returned, can be null.



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.