Java Doc for StatementImpl.java in  » Database-JDBC-Connection-Pool » mysql-connector-java-5.1.3 » com » mysql » 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 JDBC Connection Pool » mysql connector java 5.1.3 » com.mysql.jdbc 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   com.mysql.jdbc.StatementImpl

StatementImpl
public class StatementImpl implements Statement(Code)
A Statement object is used for executing a static SQL statement and obtaining the results produced by it.

Only one ResultSet per Statement can be open at any point in time. Therefore, if the reading of one ResultSet is interleaved with the reading of another, each must have been generated by different Statements. All statement execute methods implicitly close a statement's current ResultSet if an open one exists.


author:
   Mark Matthews
version:
   $Id: Statement.java 4624 2005-11-28 14:24:29 -0600 (Mon, 28 Nov
version:
   2005) mmatthews $
See Also:   java.sql.Statement
See Also:   ResultSetInternalMethods

Inner Class :class CancelTask extends TimerTask

Field Summary
final protected static  StringPING_MARKER
    
final public static  byteUSES_VARIABLES_FALSE
    
final public static  byteUSES_VARIABLES_TRUE
    
final public static  byteUSES_VARIABLES_UNKNOWN
    
protected  ListbatchedArgs
    
protected  ArrayListbatchedGeneratedKeys
    
protected  ObjectcancelTimeoutMutex
     Mutex to prevent race between returning query results and noticing that we're timed-out or cancelled.
protected  SingleByteCharsetConvertercharConverter
    
protected  StringcharEncoding
    
protected  ConnectionImplconnection
    
protected  longconnectionId
    
protected  booleancontinueBatchOnError
    
protected  StringcurrentCatalog
    
protected  booleandoEscapeProcessing
    
protected  ProfileEventSinkeventSink
    
protected  booleanholdResultsOpenOverClose
    
protected  booleanisClosed
    
protected  longlastInsertId
    
protected  intmaxFieldSize
    
protected  intmaxRows
    
protected  booleanmaxRowsChanged
    
protected  ListopenResults
    
protected  booleanpedantic
    
protected  PingTargetpingTarget
    
protected  ThrowablepointOfOrigin
     Where this statement was created, only used if profileSql or useUsageAdvisor set to true.
protected  booleanprofileSQL
    
protected  intresultSetConcurrency
    
protected  intresultSetType
    
protected  ResultSetInternalMethodsresults
    
protected  booleanretrieveGeneratedKeys
    
protected static  intstatementCounter
     Used to generate IDs when profiling.
protected  intstatementId
     Used to identify this statement when profiling.
protected  inttimeoutInMillis
    
protected  longupdateCount
    
protected  booleanuseUsageAdvisor
    
protected  SQLWarningwarningChain
     The warnings chain.
protected  booleanwasCancelled
    
protected  booleanwasCancelledByTimeout
    

Constructor Summary
public  StatementImpl(ConnectionImpl c, String catalog)
     Constructor for a Statement.

Method Summary
public synchronized  voidaddBatch(String sql)
    
public  voidcancel()
     Cancels this Statement object if both the DBMS and driver support aborting an SQL statement.
protected  voidcheckClosed()
    
protected  voidcheckForDml(String sql, char firstStatementChar)
     Checks if the given SQL query with the given first non-ws char is a DML statement.
protected  voidcheckNullOrEmptyQuery(String sql)
     Method checkNullOrEmptyQuery.
public synchronized  voidclearBatch()
     JDBC 2.0 Make 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  voidcloseAllOpenResults()
    
protected  booleancreateStreamingResultSet()
    
public  voiddisableStreamingResults()
    
protected  voiddoPingInstead()
    
public  voidenableStreamingResults()
    
public  booleanexecute(String sql)
     Execute a SQL statement that may return multiple results.
public  booleanexecute(String sql, int returnGeneratedKeys)
    
public  booleanexecute(String sql, int[] generatedKeyIndices)
    
public  booleanexecute(String sql, String[] generatedKeyNames)
    
public synchronized  int[]executeBatch()
     JDBC 2.0 Submit a batch of commands to the database for execution.
public  java.sql.ResultSetexecuteQuery(String sql)
    
protected  voidexecuteSimpleNonQuery(ConnectionImpl c, String nonQuery)
    
public  intexecuteUpdate(String sql)
     Execute a SQL INSERT, UPDATE or DELETE statement.
protected  intexecuteUpdate(String sql, boolean isBatch)
    
public  intexecuteUpdate(String sql, int returnGeneratedKeys)
    
public  intexecuteUpdate(String sql, int[] generatedKeyIndices)
    
public  intexecuteUpdate(String sql, String[] generatedKeyNames)
    
protected  intfindStartOfStatement(String sql)
    
protected  ResultSetInternalMethodsgeneratePingResultSet()
    
protected  voidgetBatchedGeneratedKeys(java.sql.Statement batchedStatement)
    
protected  voidgetBatchedGeneratedKeys()
    
protected  CalendargetCalendarInstanceForSessionOrNew()
    
public  java.sql.ConnectiongetConnection()
     JDBC 2.0 Return the Connection that produced the Statement.
public  intgetFetchDirection()
     JDBC 2.0 Determine the fetch direction.
public  intgetFetchSize()
     JDBC 2.0 Determine the default fetch size.
public synchronized  java.sql.ResultSetgetGeneratedKeys()
    
protected  java.sql.ResultSetgetGeneratedKeysInternal()
    
protected  intgetId()
    
public  longgetLastInsertID()
     getLastInsertID returns the value of the auto_incremented key after an executeQuery() or excute() call.
public synchronized  InputStreamgetLocalInfileInputStream()
    
public  longgetLongUpdateCount()
     getLongUpdateCount returns the current result as an update count, if the result is a ResultSet or there are no more results, -1 is returned.
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 Determine the result set concurrency.
public  intgetResultSetHoldability()
    
protected  ResultSetInternalMethodsgetResultSetInternal()
    
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  java.sql.SQLWarninggetWarnings()
     The first warning reported by calls on this Statement is returned.
protected  SQLExceptionhandleExceptionForBatch(int endOfBatchIndex, int numValuesPerBatch, int[] updateCounts, SQLException ex)
    
public synchronized  booleanisClosed()
    
public  booleanisPoolable()
    
public  booleanisWrapperFor(Class iface)
     Returns true if this either implements the interface argument or is directly or indirectly a wrapper for an object that does.
protected  intprocessMultiCountsAndKeys(StatementImpl batchedStatement, int updateCountCounter, int[] updateCounts)
    
protected  voidrealClose(boolean calledExplicitly, boolean closeOpenResults)
     Closes this statement, and frees resources.
protected synchronized  voidresetCancelledState()
    
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 Give a hint as to the direction in which the rows in a result set will be processed.
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.
protected  voidsetHoldResultsOpenOverClose(boolean holdResultsOpenOverClose)
    
public synchronized  voidsetLocalInfileInputStream(InputStream stream)
    
public  voidsetMaxFieldSize(int max)
    
public  voidsetMaxRows(int max)
    
public synchronized  voidsetPingTarget(PingTarget pingTarget)
    
public  voidsetPoolable(boolean poolable)
    
public  voidsetQueryTimeout(int seconds)
    
 voidsetResultSetConcurrency(int concurrencyFlag)
    
 voidsetResultSetType(int typeFlag)
    
public  Objectunwrap(Class iface)
     Returns an object that implements the given interface to allow access to non-standard methods, or standard methods not exposed by the proxy. The result may be either the object found to implement the interface or a proxy for that object. If the receiver implements the interface then that is the object.

Field Detail
PING_MARKER
final protected static String PING_MARKER(Code)



USES_VARIABLES_FALSE
final public static byte USES_VARIABLES_FALSE(Code)



USES_VARIABLES_TRUE
final public static byte USES_VARIABLES_TRUE(Code)



USES_VARIABLES_UNKNOWN
final public static byte USES_VARIABLES_UNKNOWN(Code)



batchedArgs
protected List batchedArgs(Code)
Holds batched commands



batchedGeneratedKeys
protected ArrayList batchedGeneratedKeys(Code)



cancelTimeoutMutex
protected Object cancelTimeoutMutex(Code)
Mutex to prevent race between returning query results and noticing that we're timed-out or cancelled.



charConverter
protected SingleByteCharsetConverter charConverter(Code)
The character converter to use (if available)



charEncoding
protected String charEncoding(Code)
The character encoding to use (if available)



connection
protected ConnectionImpl connection(Code)
The connection that created us



connectionId
protected long connectionId(Code)



continueBatchOnError
protected boolean continueBatchOnError(Code)



currentCatalog
protected String currentCatalog(Code)
The catalog in use



doEscapeProcessing
protected boolean doEscapeProcessing(Code)
Should we process escape codes?



eventSink
protected ProfileEventSink eventSink(Code)
If we're profiling, where should events go to?



holdResultsOpenOverClose
protected boolean holdResultsOpenOverClose(Code)
Should this statement hold results open over .close() irregardless of connection's setting?



isClosed
protected boolean isClosed(Code)
Has this statement been closed?



lastInsertId
protected long lastInsertId(Code)
The auto_increment value for the last insert



maxFieldSize
protected int maxFieldSize(Code)
The max field size for this statement



maxRows
protected int maxRows(Code)
The maximum number of rows to return for this statement (-1 means _all_ rows)



maxRowsChanged
protected boolean maxRowsChanged(Code)
Has someone changed this for this statement?



openResults
protected List openResults(Code)
List of currently-open ResultSets



pedantic
protected boolean pedantic(Code)
Are we in pedantic mode?



pingTarget
protected PingTarget pingTarget(Code)



pointOfOrigin
protected Throwable pointOfOrigin(Code)
Where this statement was created, only used if profileSql or useUsageAdvisor set to true.



profileSQL
protected boolean profileSQL(Code)
Should we profile?



resultSetConcurrency
protected int resultSetConcurrency(Code)
The concurrency for this result set (updatable or not)



resultSetType
protected int resultSetType(Code)
The type of this result set (scroll sensitive or in-sensitive)



results
protected ResultSetInternalMethods results(Code)
The current results



retrieveGeneratedKeys
protected boolean retrieveGeneratedKeys(Code)



statementCounter
protected static int statementCounter(Code)
Used to generate IDs when profiling.



statementId
protected int statementId(Code)
Used to identify this statement when profiling.



timeoutInMillis
protected int timeoutInMillis(Code)
The timeout for a query



updateCount
protected long updateCount(Code)
The update count for this statement



useUsageAdvisor
protected boolean useUsageAdvisor(Code)
Should we use the usage advisor?



warningChain
protected SQLWarning warningChain(Code)
The warnings chain.



wasCancelled
protected boolean wasCancelled(Code)



wasCancelledByTimeout
protected boolean wasCancelledByTimeout(Code)




Constructor Detail
StatementImpl
public StatementImpl(ConnectionImpl c, String catalog) throws SQLException(Code)
Constructor for a Statement.
Parameters:
  c - the Connection instantation that creates us
Parameters:
  catalog - the database name in use when we were created
throws:
  SQLException - if an error occurs.




Method Detail
addBatch
public synchronized void addBatch(String sql) throws SQLException(Code)
DOCUMENT ME!
Parameters:
  sql - DOCUMENT ME!
throws:
  SQLException - DOCUMENT ME!



cancel
public void cancel() throws SQLException(Code)
Cancels this Statement object if both the DBMS and driver support aborting an SQL statement. This method can be used by one thread to cancel a statement that is being executed by another thread.



checkClosed
protected void checkClosed() throws SQLException(Code)
Checks if closed() has been called, and throws an exception if so
throws:
  SQLException - if this statement has been closed



checkForDml
protected void checkForDml(String sql, char firstStatementChar) throws SQLException(Code)
Checks if the given SQL query with the given first non-ws char is a DML statement. Throws an exception if it is.
Parameters:
  sql - the SQL to check
Parameters:
  firstStatementChar - the UC first non-ws char of the statement
throws:
  SQLException - if the statement contains DML



checkNullOrEmptyQuery
protected void checkNullOrEmptyQuery(String sql) throws SQLException(Code)
Method checkNullOrEmptyQuery.
Parameters:
  sql - the SQL to check
throws:
  SQLException - if query is null or empty.



clearBatch
public synchronized void clearBatch() throws SQLException(Code)
JDBC 2.0 Make the set of commands in the current batch empty. This method is optional.
exception:
  SQLException - if a database-access error occurs, or the driver does notsupport 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



closeAllOpenResults
protected void closeAllOpenResults()(Code)
Close any open result sets that have been 'held open'



createStreamingResultSet
protected boolean createStreamingResultSet()(Code)
We only stream result sets when they are forward-only, read-only, and the fetch size has been set to Integer.MIN_VALUE true if this result set should be streamed row at-a-time, ratherthan read all at once.



disableStreamingResults
public void disableStreamingResults() throws SQLException(Code)



doPingInstead
protected void doPingInstead() throws SQLException(Code)



enableStreamingResults
public void enableStreamingResults() throws SQLException(Code)



execute
public boolean execute(String sql) throws SQLException(Code)
Execute a SQL statement that may return multiple results. We don't have to worry about this since we do not support multiple ResultSets. You can use getResultSet or getUpdateCount to retrieve the result.
Parameters:
  sql - any SQL statement true if the next result is a ResulSet, false if it is an updatecount or there are no more results
exception:
  SQLException - if a database access error occurs



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

See Also:   StatementImpl.execute(Stringint)



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

See Also:   StatementImpl.execute(Stringint[])



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

See Also:   StatementImpl.execute(StringString[])



executeBatch
public synchronized int[] executeBatch() throws SQLException(Code)
JDBC 2.0 Submit a batch of commands to the database for execution. This method is optional. an array of update counts containing one element for each commandin the batch. The array is ordered according to the order inwhich commands were inserted into the batch
exception:
  SQLException - if a database-access error occurs, or the driver does notsupport batch statements
throws:
  java.sql.BatchUpdateException - DOCUMENT ME!



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



executeSimpleNonQuery
protected void executeSimpleNonQuery(ConnectionImpl c, String nonQuery) throws SQLException(Code)



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 casting this Statement to org.gjt.mm.mysql.Statement and calling the getLastInsertID() method.
Parameters:
  sql - a SQL statement either a row count, or 0 for SQL commands
exception:
  SQLException - if a database access error occurs



executeUpdate
protected int executeUpdate(String sql, boolean isBatch) throws SQLException(Code)



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

See Also:   StatementImpl.executeUpdate(Stringint)



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

See Also:   StatementImpl.executeUpdate(Stringint[])



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

See Also:   StatementImpl.executeUpdate(StringString[])



findStartOfStatement
protected int findStartOfStatement(String sql)(Code)



generatePingResultSet
protected ResultSetInternalMethods generatePingResultSet() throws SQLException(Code)



getBatchedGeneratedKeys
protected void getBatchedGeneratedKeys(java.sql.Statement batchedStatement) throws SQLException(Code)



getBatchedGeneratedKeys
protected void getBatchedGeneratedKeys() throws SQLException(Code)



getCalendarInstanceForSessionOrNew
protected Calendar getCalendarInstanceForSessionOrNew()(Code)
Optimization to only use one calendar per-session, or calculate it for each call, depending on user configuration



getConnection
public java.sql.Connection getConnection() throws SQLException(Code)
JDBC 2.0 Return the Connection that produced the Statement. the Connection that produced the Statement
throws:
  SQLException - if an error occurs



getFetchDirection
public int getFetchDirection() throws SQLException(Code)
JDBC 2.0 Determine the fetch direction. the default fetch direction
exception:
  SQLException - if a database-access error occurs



getFetchSize
public int getFetchSize() throws SQLException(Code)
JDBC 2.0 Determine the default fetch size. the number of rows to fetch at a time
throws:
  SQLException - if an error occurs



getGeneratedKeys
public synchronized java.sql.ResultSet getGeneratedKeys() throws SQLException(Code)
DOCUMENT ME! DOCUMENT ME!
throws:
  SQLException - DOCUMENT ME!



getGeneratedKeysInternal
protected java.sql.ResultSet getGeneratedKeysInternal() throws SQLException(Code)



getId
protected int getId()(Code)
Returns the id used when profiling the id used when profiling.



getLastInsertID
public long getLastInsertID()(Code)
getLastInsertID returns the value of the auto_incremented key after an executeQuery() or excute() call.

This gets around the un-threadsafe behavior of "select LAST_INSERT_ID()" which is tied to the Connection that created this Statement, and therefore could have had many INSERTS performed before one gets a chance to call "select LAST_INSERT_ID()".

the last update ID.



getLocalInfileInputStream
public synchronized InputStream getLocalInfileInputStream()(Code)



getLongUpdateCount
public long getLongUpdateCount()(Code)
getLongUpdateCount 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.

This method returns longs as MySQL server versions newer than 3.22.4 return 64-bit values for update counts

the current update count.



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)

See Also:   StatementImpl.getMoreResults(int)



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 (why?)



getResultSetConcurrency
public int getResultSetConcurrency() throws SQLException(Code)
JDBC 2.0 Determine the result set concurrency. CONCUR_UPDATABLE or CONCUR_READONLY
throws:
  SQLException - if an error occurs



getResultSetHoldability
public int getResultSetHoldability() throws SQLException(Code)

See Also:   StatementImpl.getResultSetHoldability



getResultSetInternal
protected ResultSetInternalMethods getResultSetInternal()(Code)



getResultSetType
public int getResultSetType() throws SQLException(Code)
JDBC 2.0 Determine the result set type. the ResultSet type (SCROLL_SENSITIVE or SCROLL_INSENSITIVE)
throws:
  SQLException - if an error occurs.



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 java.sql.SQLWarning getWarnings() throws SQLException(Code)
The first warning reported by calls on this Statement is returned. A Statement's execute methods clear its java.sql.SQLWarning chain. Subsequent Statement warnings will be chained to this java.sql.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 java.sql.SQLWarning or null
exception:
  SQLException - if a database access error occurs



handleExceptionForBatch
protected SQLException handleExceptionForBatch(int endOfBatchIndex, int numValuesPerBatch, int[] updateCounts, SQLException ex) throws BatchUpdateException(Code)



isClosed
public synchronized boolean isClosed() throws SQLException(Code)



isPoolable
public boolean isPoolable() throws SQLException(Code)



isWrapperFor
public boolean isWrapperFor(Class iface) throws SQLException(Code)
Returns true if this either implements the interface argument or is directly or indirectly a wrapper for an object that does. Returns false otherwise. If this implements the interface then return true, else if this is a wrapper then return the result of recursively calling isWrapperFor on the wrapped object. If this does not implement the interface and is not a wrapper, return false. This method should be implemented as a low-cost operation compared to unwrap so that callers can use this method to avoid expensive unwrap calls that may fail. If this method returns true then calling unwrap with the same argument should succeed.
Parameters:
  interfaces - 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 wrapperfor an object with the given interface.
since:
   1.6



processMultiCountsAndKeys
protected int processMultiCountsAndKeys(StatementImpl batchedStatement, int updateCountCounter, int[] updateCounts) throws SQLException(Code)



realClose
protected void realClose(boolean calledExplicitly, boolean closeOpenResults) throws SQLException(Code)
Closes this statement, and frees resources.
Parameters:
  calledExplicitly - was this called from close()?
throws:
  SQLException - if an error occurs



resetCancelledState
protected synchronized void resetCancelledState()(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.

Note: This MySQL driver does not support cursors.


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 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 direction is not oneof ResultSet.FETCH_FORWARD, ResultSet.FETCH_REVERSE, orResultSet.FETCH_UNKNOWN



setFetchSize
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 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 the condition 0<= rows <= this.getMaxRows() is not satisfied.



setHoldResultsOpenOverClose
protected void setHoldResultsOpenOverClose(boolean holdResultsOpenOverClose)(Code)



setLocalInfileInputStream
public synchronized void setLocalInfileInputStream(InputStream stream)(Code)



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



setPingTarget
public synchronized void setPingTarget(PingTarget pingTarget)(Code)



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



setResultSetConcurrency
void setResultSetConcurrency(int concurrencyFlag)(Code)
Sets the concurrency for result sets generated by this statement
Parameters:
  concurrencyFlag - DOCUMENT ME!



setResultSetType
void setResultSetType(int typeFlag)(Code)
Sets the result set type for result sets generated by this statement
Parameters:
  typeFlag - DOCUMENT ME!



unwrap
public Object unwrap(Class iface) throws java.sql.SQLException(Code)
Returns an object that implements the given interface to allow access to non-standard methods, or standard methods not exposed by the proxy. The result may be either the object found to implement the interface or a proxy for that object. If the receiver implements the interface then that is the object. If the receiver is a wrapper and the wrapped object implements the interface then that is the object. Otherwise the object is the result of calling unwrap recursively on the wrapped object. If the receiver is not a wrapper and does not implement the interface, then an SQLException is thrown.
Parameters:
  iface - A Class defining an interface that the result must implement. an object that implements the interface. May be a proxy for the actual implementing object.
throws:
  java.sql.SQLException - If no object found that implements the interface
since:
   1.6



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.