Java Doc for Statement.java in  » Database-JDBC-Connection-Pool » octopus » com » internetcds » jdbc » tds » 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 JDBC Connection Pool » octopus » com.internetcds.jdbc.tds 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   com.internetcds.jdbc.tds.Statement

All known Subclasses:   com.internetcds.jdbc.tds.PreparedStatement_base,
Statement
public class Statement implements java.sql.Statement(Code)


Field Summary
final public static  StringcvsVersion
    
protected  java.sql.ResultSetresults
    
protected  Tdstds
    
protected  inttimeout
    
protected  intupdateCount
    
protected  SQLWarningChainwarningChain
    

Constructor Summary
public  Statement(Object connection_, Tds tds_)
     Constructor for a Statement.

Method Summary
public  voidaddBatch(String sql)
     JDBC 2.0 Adds a SQL command to the current batch of commmands for the statement.
public  voidcancel()
    
public  voidclearBatch()
     JDBC 2.0 Makes the set of commands in the current batch empty.
public  voidclearWarnings()
     After this call, getWarnings returns null until a new warning is reported for this Statement.
public  voidclose()
     In many cases, it is desirable to immediately release a Statement's database and JDBC resources instead of waiting for this to happen when it is automatically closed.
protected  voidcloseResults()
    
public  voidcommit()
    
public  booleanexecute(String sql)
    
public  booleanexecute(String sql, int autoGeneratedKeys)
    
public  booleanexecute(String sql, int[] columnIndexes)
    
public  booleanexecute(String sql, String[] columnNames)
    
public  int[]executeBatch()
     JDBC 2.0 Submits a batch of commands to the database for execution. This method is optional. an array of update counts containing one element for eachcommand in the batch.
public  java.sql.ResultSetexecuteQuery(String sql)
    
public  intexecuteUpdate(String sql)
     Execute a SQL INSERT, UPDATE or DELETE statement.
public  intexecuteUpdate(String sql, int autoGeneratedKeys)
    
public  intexecuteUpdate(String sql, int[] columnIndexes)
    
public  intexecuteUpdate(String sql, String[] columnNames)
    
protected  voidfinalize()
    
public  java.sql.ConnectiongetConnection()
     JDBC 2.0 Returns the Connection object that produced this Statement object.
public  intgetFetchDirection()
     JDBC 2.0 Retrieves the direction for fetching rows from database tables that is the default for result sets generated from this Statement object.
public  intgetFetchSize()
     JDBC 2.0 Retrieves the number of result set rows that is the default fetch size for result sets generated from this Statement object.
public  ResultSetgetGeneratedKeys()
    
public  intgetMaxFieldSize()
     The maxFieldSize limit (in bytes) is the maximum amount of data returned for any column value; it only applies to BINARY, VARBINARY, LONGVARBINARY, CHAR, VARCHAR and LONGVARCHAR columns.
public  intgetMaxRows()
     The maxRows limit is set to limit the number of rows that any ResultSet can contain.
public  booleangetMoreResults()
     getMoreResults moves to a Statement's next result.
public  booleangetMoreResults(int current)
    
public  intgetQueryTimeout()
     The queryTimeout limit is the number of seconds the driver will wait for a Statement to execute.
public  java.sql.ResultSetgetResultSet()
     getResultSet returns the current result as a ResultSet.
public  intgetResultSetConcurrency()
     JDBC 2.0 Retrieves the result set concurrency.
public  intgetResultSetHoldability()
    
public  intgetResultSetType()
     JDBC 2.0 Determine the result set type.
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.
public  SQLWarninggetWarnings()
     The first warning reported by calls on this Statement is returned.
public  booleanisClosed()
    
public  booleanisPoolable()
    
public  booleanisWrapperFor(Class iface)
    
public static  voidmain(String args)
    
public  voidrollback()
    
public  voidsetCursorName(String name)
     setCursorName defines the SQL cursor name that will be used by subsequent execute methods.
public  voidsetEscapeProcessing(boolean enable)
     If escape scanning is on (the default), the driver will do escape substitution before sending the SQL to the database.
public  voidsetFetchDirection(int direction)
     JDBC 2.0 Gives the driver a hint as to the direction in which the rows in a result set will be processed.
public  voidsetFetchSize(int rows)
     JDBC 2.0 Gives the JDBC driver a hint as to the number of rows that should be fetched from the database when more rows are needed.
public  voidsetMaxFieldSize(int max)
    
public  voidsetMaxRows(int max)
    
public  voidsetPoolable(boolean poolable)
    
public  voidsetQueryTimeout(int seconds)
    
protected  voidstartResultSet()
    
public  Tunwrap(Class<T> iface)
    

Field Detail
cvsVersion
final public static String cvsVersion(Code)



results
protected java.sql.ResultSet results(Code)



tds
protected Tds tds(Code)



timeout
protected int timeout(Code)



updateCount
protected int updateCount(Code)



warningChain
protected SQLWarningChain warningChain(Code)




Constructor Detail
Statement
public Statement(Object connection_, Tds tds_) throws SQLException(Code)
Constructor for a Statement. It simply sets the connection that created us.
Parameters:
  connection_ - the Connection instantation that creates us
Parameters:
  tds_ - a TDS instance to use for communication with server.




Method Detail
addBatch
public void addBatch(String sql) throws SQLException(Code)
JDBC 2.0 Adds a SQL command to the current batch of commmands for the statement. This method is optional.
Parameters:
  sql - typically this is a static SQL INSERT or UPDATE statement
exception:
  SQLException - if a database access error occurs, or thedriver does not support batch statements



cancel
public void cancel() throws SQLException(Code)

exception:
  SQLException -



clearBatch
public void clearBatch() throws SQLException(Code)
JDBC 2.0 Makes the set of commands in the current batch empty. This method is optional.
exception:
  SQLException - if a database access error occurs or thedriver does not support batch statements



clearWarnings
public void clearWarnings() throws SQLException(Code)
After this call, getWarnings returns null until a new warning is reported for this Statement.
exception:
  SQLException - if a database access error occurs (why?)



close
public void close() throws SQLException(Code)
In many cases, it is desirable to immediately release a Statement'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 - if a database access error occurs (why?)




closeResults
protected void closeResults() throws java.sql.SQLException(Code)



commit
public void commit() throws java.sql.SQLException, java.io.IOException, com.internetcds.jdbc.tds.TdsUnknownPacketSubType, com.internetcds.jdbc.tds.TdsException(Code)



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

Parameters:
  sql - any SQL statement true if the next result is a ResulSet, false if it isan update count or there are no more results
exception:
  SQLException - if a database access error occurs



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



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



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



executeBatch
public int[] executeBatch() throws SQLException(Code)
JDBC 2.0 Submits a batch of commands to the database for execution. This method is optional. an array of update counts containing one element for eachcommand in the batch. The array is ordered accordingto the order in which commands were inserted into the batch.
exception:
  SQLException - if a database access error occurs or thedriver does not support batch statements



executeQuery
public java.sql.ResultSet executeQuery(String sql) throws SQLException(Code)
Execute a SQL statement that retruns a single ResultSet
Parameters:
  Sql - typically a static SQL SELECT statement a ResulSet that contains the data produced by the query
exception:
  SQLException - if a database access error occurs



executeUpdate
public int executeUpdate(String sql) throws SQLException(Code)
Execute a SQL INSERT, UPDATE or DELETE statement. In addition SQL statements that return nothing such as SQL DDL statements can be executed Any IDs generated for AUTO_INCREMENT fields can be retrieved by looking through the SQLWarning chain of this statement for warnings of the form "LAST_INSERTED_ID = 'some number', COMMAND = 'your sql'".
Parameters:
  Sql - a SQL statement either a row count, or 0 for SQL commands
exception:
  SQLException - if a database access error occurs



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



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



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



finalize
protected void finalize() throws Throwable(Code)



getConnection
public java.sql.Connection getConnection() throws SQLException(Code)
JDBC 2.0 Returns the Connection object that produced this Statement object. the connection that produced this statement
exception:
  SQLException - if a database access error occurs



getFetchDirection
public int getFetchDirection() throws SQLException(Code)
JDBC 2.0 Retrieves the direction for fetching rows from database tables that is the default for result sets generated from this Statement object. If this Statement object has not set a fetch direction by calling the method setFetchDirection, the return value is implementation-specific. the default fetch direction for result sets generatedfrom this Statement object
exception:
  SQLException - if a database access error occurs



getFetchSize
public int getFetchSize() throws SQLException(Code)
JDBC 2.0 Retrieves the number of result set rows that is the default fetch size for result sets generated from this Statement object. If this Statement object has not set a fetch size by calling the method setFetchSize, the return value is implementation-specific. the default fetch size for result sets generatedfrom this Statement object
exception:
  SQLException - if a database access error occurs



getGeneratedKeys
public ResultSet getGeneratedKeys() throws SQLException(Code)



getMaxFieldSize
public int getMaxFieldSize() throws SQLException(Code)
The maxFieldSize limit (in bytes) is the maximum amount of data returned for any column value; it only applies to BINARY, VARBINARY, LONGVARBINARY, CHAR, VARCHAR and LONGVARCHAR columns. If the limit is exceeded, the excess data is silently discarded. the current max column size limit; zero means unlimited
exception:
  SQLException - if a database access error occurs



getMaxRows
public int getMaxRows() 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. the current maximum row limit; zero means unlimited
exception:
  SQLException - if a database access error occurs



getMoreResults
public boolean getMoreResults() throws SQLException(Code)
getMoreResults moves to a Statement's next result. If it returns true, this result is a ResulSet. true if the next ResultSet is valid
exception:
  SQLException - if a database access error occurs



getMoreResults
public boolean getMoreResults(int current) throws SQLException(Code)



getQueryTimeout
public int getQueryTimeout() throws SQLException(Code)
The queryTimeout limit is the number of seconds the driver will wait for a Statement to execute. If the limit is exceeded, a SQLException is thrown. the current query timeout limit in seconds; 0 = unlimited
exception:
  SQLException - if a database access error occurs



getResultSet
public java.sql.ResultSet getResultSet() throws SQLException(Code)
getResultSet returns the current result as a ResultSet. It should only be called once per result. the current result set; null if there are no more
exception:
  SQLException - if a database access error occurs



getResultSetConcurrency
public int getResultSetConcurrency() throws SQLException(Code)
JDBC 2.0 Retrieves the result set concurrency.



getResultSetHoldability
public int getResultSetHoldability() throws SQLException(Code)



getResultSetType
public int getResultSetType() throws SQLException(Code)
JDBC 2.0 Determine the result set type.



getUpdateCount
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 current result as an update count.
exception:
  SQLException - if a database access error occurs



getWarnings
public SQLWarning getWarnings() throws SQLException(Code)
The first warning reported by calls on this Statement is returned. A Statement'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 on null
exception:
  SQLException - if a database access error occurs




isClosed
public boolean isClosed()(Code)



isPoolable
public boolean isPoolable() throws SQLException(Code)



isWrapperFor
public boolean isWrapperFor(Class iface) throws SQLException(Code)



main
public static void main(String args) throws java.lang.ClassNotFoundException, java.lang.IllegalAccessException, java.lang.InstantiationException, SQLException(Code)



rollback
public void rollback() throws java.sql.SQLException, java.io.IOException, com.internetcds.jdbc.tds.TdsUnknownPacketSubType, com.internetcds.jdbc.tds.TdsException(Code)



setCursorName
public void setCursorName(String name) throws SQLException(Code)
setCursorName defines the SQL cursor name that will be used by subsequent 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 statement. If a database doesn't support positioned update/delete, this method is a no-op.
Parameters:
  name - the new cursor name
exception:
  SQLException - if a database access error occurs



setEscapeProcessing
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 - if a database access error occurs



setFetchDirection
public void setFetchDirection(int direction) throws SQLException(Code)
JDBC 2.0 Gives the driver 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.

Note that this method sets the default fetch direction for result sets generated by this Statement object. Each result set has its own methods for getting and setting its own fetch direction.
Parameters:
  direction - the initial direction for processing rows
exception:
  SQLException - if a database access error occursor the given directionis not one of ResultSet.FETCH_FORWARD, ResultSet.FETCH_REVERSE, orResultSet.FETCH_UNKNOWN




setFetchSize
public void setFetchSize(int rows) throws SQLException(Code)
JDBC 2.0 Gives 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 affects only result sets created using this statement. 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
public void setMaxFieldSize(int max) throws SQLException(Code)
Sets the maxFieldSize
Parameters:
  max - the new max column size limit; zero means unlimited
exception:
  SQLException - if size exceeds buffer size



setMaxRows
public void setMaxRows(int max) throws SQLException(Code)
Set the maximum number of rows
Parameters:
  max - the new max rows limit; zero means unlimited
exception:
  SQLException - if a database access error occurs
See Also:   getMaxRows



setPoolable
public void setPoolable(boolean poolable) throws SQLException(Code)



setQueryTimeout
public void setQueryTimeout(int seconds) throws SQLException(Code)
Sets the queryTimeout limit
Parameters:
  seconds - - the new query timeout limit in seconds
exception:
  SQLException - if a database access error occurs



startResultSet
protected void startResultSet() throws SQLException(Code)



unwrap
public T unwrap(Class<T> iface) throws SQLException(Code)



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.