Java Doc for Statement.java in  » Apache-Harmony-Java-SE » java-package » java » sql » 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 » Apache Harmony Java SE » java package » java.sql 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.sql.Statement

Statement
public interface Statement (Code)
Interface used for executing static SQL statements and returning their results. By default, an object implementing the Statement interface can returns results as ResultSets. For any given Statement object, only one ResultSet can be open at one time. A call to any of the execution methods of Statement will cause any previously created ResultSet object for that Statement to be closed implicitly.

To have multiple ResultSet objects open concurrently, multiple Statement objects must be used.



Field Summary
final public static  intCLOSE_ALL_RESULTS
     Passing this constant to getMoreResults implies that all ResultSet objects previously kept open should be closed.
final public static  intCLOSE_CURRENT_RESULT
    
final public static  intEXECUTE_FAILED
     Indicates that an error was encountered during execution of a batch statement.
final public static  intKEEP_CURRENT_RESULT
     Passing this constant to getMoreResults implies that the current ResultSet object should not be closed.
final public static  intNO_GENERATED_KEYS
     Indicates that generated keys should not be accessible for retrieval.
final public static  intRETURN_GENERATED_KEYS
     Indicates that generated keys should be accessible for retrieval.
final public static  intSUCCESS_NO_INFO
     Indicates that a batch statement was executed with a successful result, but a count of the number of rows it affected is unavailable.


Method Summary
public  voidaddBatch(String sql)
     Adds a specified SQL commands to the list of commands for this Statement.

The list of commands is executed by invoking the executeBatch method.
Parameters:
  sql - the SQL command as a String.

public  voidcancel()
     Cancels this Statement execution if both the database and the JDBC driver support aborting an SQL statement in flight.
public  voidclearBatch()
     Clears the current list of SQL commands for this Statement.
public  voidclearWarnings()
     Clears all SQLWarnings from this Statement.
public  voidclose()
     Releases this Statement's database and JDBC driver resources.

Using this method to release these resources as soon as possible is strongly recommended.

public  booleanexecute(String sql)
     Executes a supplied SQL statement.
public  booleanexecute(String sql, int autoGeneratedKeys)
     Executes a supplied SQL statement.
public  booleanexecute(String sql, int[] columnIndexes)
     Executes the supplied SQL statement.
public  booleanexecute(String sql, String[] columnNames)
     Executes the supplied SQL statement.
public  int[]executeBatch()
     Submits a batch of SQL commands to the database.
public  ResultSetexecuteQuery(String sql)
     Executes a supplied SQL statement.
public  intexecuteUpdate(String sql)
     Executes the supplied SQL statement.
public  intexecuteUpdate(String sql, int autoGeneratedKeys)
     Executes the supplied SQL statement.
public  intexecuteUpdate(String sql, int[] columnIndexes)
     Executes the supplied SQL statement.
public  intexecuteUpdate(String sql, String[] columnNames)
     Executes the supplied SQL statement.
public  ConnectiongetConnection()
     Gets the Connection that produced this Statement.
public  intgetFetchDirection()
     Gets the default direction for fetching rows for ResultSets generated from this Statement.
public  intgetFetchSize()
     Gets the default number of rows for a fetch for the ResultSet objects returned from this Statement.
public  ResultSetgetGeneratedKeys()
     Returns auto generated keys created by executing this Statement.
public  intgetMaxFieldSize()
     Gets the maximum number of bytes which can be returned for values from Character and Binary values in a ResultSet derived from this Statement. This limit applies to BINARY, VARBINARY, LONGVARBINARY, CHAR, VARCHAR, and LONGVARCHAR types.
public  intgetMaxRows()
     Gets the maximum number of rows that a ResultSet can contain when produced from this Statement.
public  booleangetMoreResults()
     Moves to this Statement's next result.
public  booleangetMoreResults(int current)
     Moves to this Statement's next result.
public  intgetQueryTimeout()
     Gets the timeout value for Statement execution.
public  ResultSetgetResultSet()
     Gets the current result.
public  intgetResultSetConcurrency()
     Gets the concurrency setting for ResultSet objects generated by this Statement.
public  intgetResultSetHoldability()
     Gets the cursor hold setting for ResultSet objects generated by this Statement.
public  intgetResultSetType()
     Gets the ResultSet type setting for ResultSets derived from this Statement.
public  intgetUpdateCount()
     Gets an update count for the current result if it is not a ResultSet. the current result as an update count.
public  SQLWarninggetWarnings()
     Retrieves the first SQLWarning reported by calls on this Statement.
public  voidsetCursorName(String name)
     Sets the SQL cursor name.
public  voidsetEscapeProcessing(boolean enable)
     Sets Escape Processing mode.

If Escape Processing is on, the JDBC driver will do escape substitution on an SQL statement before sending it for execution.

public  voidsetFetchDirection(int direction)
     Sets the fetch direction - a hint to the JDBC driver about the direction of processing of rows in ResultSets created by this Statement.
public  voidsetFetchSize(int rows)
     Sets the fetch size.
public  voidsetMaxFieldSize(int max)
     Sets the maximum number of bytes for ResultSet columns that contain character or binary values.
public  voidsetMaxRows(int max)
     Sets the maximum number of rows that any ResultSet can contain.
public  voidsetQueryTimeout(int seconds)
     Sets the timeout, in seconds, for queries - how long the driver will allow for completion of a Statement execution.

Field Detail
CLOSE_ALL_RESULTS
final public static int CLOSE_ALL_RESULTS(Code)
Passing this constant to getMoreResults implies that all ResultSet objects previously kept open should be closed.



CLOSE_CURRENT_RESULT
final public static int CLOSE_CURRENT_RESULT(Code)
Passing this constant to getMoreResults implies that the current ResultSet object should be closed



EXECUTE_FAILED
final public static int EXECUTE_FAILED(Code)
Indicates that an error was encountered during execution of a batch statement.



KEEP_CURRENT_RESULT
final public static int KEEP_CURRENT_RESULT(Code)
Passing this constant to getMoreResults implies that the current ResultSet object should not be closed.



NO_GENERATED_KEYS
final public static int NO_GENERATED_KEYS(Code)
Indicates that generated keys should not be accessible for retrieval.



RETURN_GENERATED_KEYS
final public static int RETURN_GENERATED_KEYS(Code)
Indicates that generated keys should be accessible for retrieval.



SUCCESS_NO_INFO
final public static int SUCCESS_NO_INFO(Code)
Indicates that a batch statement was executed with a successful result, but a count of the number of rows it affected is unavailable.





Method Detail
addBatch
public void addBatch(String sql) throws SQLException(Code)
Adds a specified SQL commands to the list of commands for this Statement.

The list of commands is executed by invoking the executeBatch method.
Parameters:
  sql - the SQL command as a String. Typically an INSERT or UPDATEstatement.
throws:
  SQLException - if an error occurs accessing the database or the databasedoes not support batch updates




cancel
public void cancel() throws SQLException(Code)
Cancels this Statement execution if both the database and the JDBC driver support aborting an SQL statement in flight. This method can be used by one thread to stop a Statement that is being executed on another thread.
throws:
  SQLException - if an error occurs accessing the database



clearBatch
public void clearBatch() throws SQLException(Code)
Clears the current list of SQL commands for this Statement.
throws:
  SQLException - if an error occurs accessing the database or the databasedoes not support batch updates



clearWarnings
public void clearWarnings() throws SQLException(Code)
Clears all SQLWarnings from this Statement.
throws:
  SQLException - if an error occurs accessing the database



close
public void close() throws SQLException(Code)
Releases this Statement's database and JDBC driver resources.

Using this method to release these resources as soon as possible is strongly recommended. It is not a good idea to rely on these resources being released when the Statement object is finalized during garbage collection. Doing so can result in unpredictable performance characteristics for the application.
throws:
  SQLException - if an error occurs accessing the database




execute
public boolean execute(String sql) throws SQLException(Code)
Executes a supplied SQL statement. This may return multiple ResultSets.

Use the getResultSet or getUpdateCount methods to get the first result and getMoreResults to get any subsequent results.
Parameters:
  sql - the SQL statement to execute true if the first result is a ResultSet, false if the firstresult is an update count or if there is no result
throws:
  SQLException - if an error occurs accessing the database




execute
public boolean execute(String sql, int autoGeneratedKeys) throws SQLException(Code)
Executes a supplied SQL statement. This may return multiple ResultSets. This method allows control of whether auto-generated Keys should be made available for retrieval, if the SQL statement is an INSERT statement.

Use the getResultSet or getUpdateCount methods to get the first result and getMoreResults to get any subsequent results.
Parameters:
  sql - the SQL statement to execute
Parameters:
  autoGeneratedKeys - a flag indicating whether to make auto generated keysavailable for retrieval. This parameter must be one ofStatement.NO_GENERATED_KEYS or Statement.RETURN_GENERATED_KEYS true if results exists and the first result is a ResultSet, falseif the first result is an update count or if there is no result
throws:
  SQLException - if an error occurs accessing the database




execute
public boolean execute(String sql, int[] columnIndexes) throws SQLException(Code)
Executes the supplied SQL statement. This may return multiple ResultSets. This method allows retrieval of auto generated keys specified by the supplied array of column indexes, if the SQL statement is an INSERT statement.

Use the getResultSet or getUpdateCount methods to get the first result and getMoreResults to get any subsequent results.
Parameters:
  sql - the SQL statement to execute
Parameters:
  columnIndexes - an array of indexes of the columns in the inserted row whichshould be made available for retrieval via thegetGeneratedKeys method. true if the first result is a ResultSet, false if the firstresult is an update count or if there is no result
throws:
  SQLException - if an error occurs accessing the database




execute
public boolean execute(String sql, String[] columnNames) throws SQLException(Code)
Executes the supplied SQL statement. This may return multiple ResultSets. This method allows retrieval of auto generated keys specified by the supplied array of column indexes, if the SQL statement is an INSERT statement.

Use the getResultSet or getUpdateCount methods to get the first result and getMoreResults to get any subsequent results.
Parameters:
  sql - the SQL statement to execute
Parameters:
  columnNames - an array of column names in the inserted row which should bemade available for retrieval via thegetGeneratedKeys method. true if the first result is a ResultSet, false if the firstresult is an update count or if there is no result
throws:
  SQLException - if an error occurs accessing the database




executeBatch
public int[] executeBatch() throws SQLException(Code)
Submits a batch of SQL commands to the database. Returns an array of update counts, if all the commands execute successfully.

If one of the commands in the batch fails, this method can throw a BatchUpdateException and the JDBC driver may or may not process the remaining commands. The JDBC driver must behave consistently with the underlying database, either always continuing or never continuing. If the driver continues processing, the array of results returned contains the same number of elements as there are commands in the batch, with a minimum of one of the elements having the EXECUTE_FAILED value. an array of update counts, with one entry for each command in thebatch. The elements are ordered according to the order in whichthe commands were added to the batch.

  1. If the value of an element is >=0, the corresponding commandcompleted successfully and the value is the update count for thatcommand, which is the number of rows in the database affected bythe command.
  2. If the value is SUCCESS_NO_INFO, the command completedsuccessfully but the number of rows affected is unknown.
  3. If the value is EXECUTE_FAILED, the command failed.

throws:
  SQLException - if an error occurs accessing the database



executeQuery
public ResultSet executeQuery(String sql) throws SQLException(Code)
Executes a supplied SQL statement. Returns a single ResultSet.
Parameters:
  sql - an SQL statement to execute. Typically a SELECT statement a ResultSet containing the data produced by the SQL statement.Never null.
throws:
  SQLException - if an error occurs accessing the database or if the statementproduces anything other than a single ResultSet



executeUpdate
public int executeUpdate(String sql) throws SQLException(Code)
Executes the supplied SQL statement. The statement may be an INSERT, UPDATE or DELETE statement or a statement which returns nothing.
Parameters:
  sql - an SQL statement to execute - an SQL INSERT, UPDATE, DELETE ora statement which returns nothing the count of updated rows, or 0 for a statement that returnsnothing.
throws:
  SQLException - if an error occurs accessing the database or if the statementproduces a ResultSet



executeUpdate
public int executeUpdate(String sql, int autoGeneratedKeys) throws SQLException(Code)
Executes the supplied SQL statement. This method allows control of whether auto-generated Keys should be made available for retrieval.
Parameters:
  sql - an SQL statement to execute - an SQL INSERT, UPDATE, DELETE ora statement which does not return anything.
Parameters:
  autoGeneratedKeys - a flag that indicates whether to allow retrieval of autogenerated keys. Parameter must be one ofStatement.RETURN_GENERATED_KEYS or Statement.NO_GENERATED_KEYS the number of updated rows, or 0 if the statement returnsnothing.
throws:
  SQLException - if an error occurs accessing the database or if the statementproduces a ResultSet



executeUpdate
public int executeUpdate(String sql, int[] columnIndexes) throws SQLException(Code)
Executes the supplied SQL statement. This method allows retrieval of auto generated keys specified by the supplied array of column indexes.
Parameters:
  sql - an SQL statement to execute - an SQL INSERT, UPDATE, DELETE ora statement which returns nothing
Parameters:
  columnIndexes - an array of indexes of the columns in the inserted row whichshould be made available for retrieval via thegetGeneratedKeys method. the count of updated rows, or 0 for a statement that returnsnothing.
throws:
  SQLException - if an error occurs accessing the database or if the statementproduces a ResultSet



executeUpdate
public int executeUpdate(String sql, String[] columnNames) throws SQLException(Code)
Executes the supplied SQL statement. This method allows retrieval of auto generated keys specified by the supplied array of column names.
Parameters:
  sql - an SQL statement to execute - an SQL INSERT, UPDATE, DELETE ora statement which returns nothing
Parameters:
  columnNames - an array of column names in the inserted row which should bemade available for retrieval via thegetGeneratedKeys method. the count of updated rows, or 0 for a statement that returnsnothing.
throws:
  SQLException - if an error occurs accessing the database or if the statementproduces a ResultSet



getConnection
public Connection getConnection() throws SQLException(Code)
Gets the Connection that produced this Statement. the Connection
throws:
  SQLException - if an error occurs accessing the database



getFetchDirection
public int getFetchDirection() throws SQLException(Code)
Gets the default direction for fetching rows for ResultSets generated from this Statement. an integer describing the default fetch direction, one of:ResultSet.FETCH_FORWARD, ResultSet.FETCH_REVERSE,ResultSet.FETCH_UNKNOWN
throws:
  SQLException - if an error occurs accessing the database



getFetchSize
public int getFetchSize() throws SQLException(Code)
Gets the default number of rows for a fetch for the ResultSet objects returned from this Statement. the default fetch size for ResultSets produced by this Statement
throws:
  SQLException - if an error occurs accessing the database



getGeneratedKeys
public ResultSet getGeneratedKeys() throws SQLException(Code)
Returns auto generated keys created by executing this Statement. a ResultSet containing the auto generated keys - empty if no keyswere generated by the Statement
throws:
  SQLException - if an error occurs accessing the database



getMaxFieldSize
public int getMaxFieldSize() throws SQLException(Code)
Gets the maximum number of bytes which can be returned for values from Character and Binary values in a ResultSet derived from this Statement. This limit applies to BINARY, VARBINARY, LONGVARBINARY, CHAR, VARCHAR, and LONGVARCHAR types. Any data exceeding the maximum size is abandoned without announcement. the current size limit, where 0 means that there is no limit
throws:
  SQLException - if an error occurs accessing the database



getMaxRows
public int getMaxRows() throws SQLException(Code)
Gets the maximum number of rows that a ResultSet can contain when produced from this Statement. If the limit is exceeded, the excess rows are discarded silently. the current row limit, where 0 means that there is no limit.
throws:
  SQLException - if an error occurs accessing the database



getMoreResults
public boolean getMoreResults() throws SQLException(Code)
Moves to this Statement's next result. Returns true if it is a ResultSet. Any current ResultSet objects previously obtained with getResultSet() are closed implicitly. true if the next result is a ResultSet, false if the next resultis not a ResultSet or if there are no more results. Note that ifthere is no more data, this method will return false andgetUpdateCount will return -1.
throws:
  SQLException - if an error occurs accessing the database



getMoreResults
public boolean getMoreResults(int current) throws SQLException(Code)
Moves to this Statement's next result. Returns true if the next result is a ResultSet. Any current ResultSet objects previously obtained with getResultSet() are handled as indicated by a supplied Flag parameter.
Parameters:
  current - a flag indicating what to do with existing ResultSets. Thisparameter must be one of Statement.CLOSE_ALL_RESULTS,Statement.CLOSE_CURRENT_RESULT orStatement.KEEP_CURRENT_RESULT. true if the next result exists and is a ResultSet, false if thenext result is not a ResultSet or if there are no more results.Note that if there is no more data, this method will return falseand getUpdateCount will return -1.
throws:
  SQLException - if an error occurs accessing the database



getQueryTimeout
public int getQueryTimeout() throws SQLException(Code)
Gets the timeout value for Statement execution. The JDBC driver will wait up to this value for the execution to complete - after the limit is exceeded an SQL Exception is thrown. the current Query Timeout value, where 0 indicates that there isno current timeout.
throws:
  SQLException - if an error occurs accessing the database



getResultSet
public ResultSet getResultSet() throws SQLException(Code)
Gets the current result. Should only be called once per result. the ResultSet for the current result. null if the result is anupdate count or if there are no more results.
throws:
  SQLException - if an error occurs accessing the database



getResultSetConcurrency
public int getResultSetConcurrency() throws SQLException(Code)
Gets the concurrency setting for ResultSet objects generated by this Statement. ResultSet.CONCUR_READ_ONLY or ResultSet.CONCUR_UPDATABLE
throws:
  SQLException - if an error occurs accessing the database



getResultSetHoldability
public int getResultSetHoldability() throws SQLException(Code)
Gets the cursor hold setting for ResultSet objects generated by this Statement. ResultSet.HOLD_CURSORS_OVER_COMMIT orResultSet.CLOSE_CURSORS_AT_COMMIT
throws:
  SQLException - if there is an error while accessing the database



getResultSetType
public int getResultSetType() throws SQLException(Code)
Gets the ResultSet type setting for ResultSets derived from this Statement. ResultSet.TYPE_FORWARD_ONLY for a ResultSet where the cursor canonly move forward, ResultSet.TYPE_SCROLL_INSENSITIVE for aResultSet which is Scrollable but is not sensitive to changesmade by others, ResultSet.TYPE_SCROLL_SENSITIVE for a ResultSetwhich is Scrollable but is sensitive to changes made by others
throws:
  SQLException - if there is an error accessing the database



getUpdateCount
public int getUpdateCount() throws SQLException(Code)
Gets an update count for the current result if it is not a ResultSet. the current result as an update count. -1 if the current resultis a ResultSet or if there are no more results
throws:
  SQLException - if an error occurs accessing the database



getWarnings
public SQLWarning getWarnings() throws SQLException(Code)
Retrieves the first SQLWarning reported by calls on this Statement.

If there are multiple warnings, subsequent warnings are chained to the first one.

The chain or warnings is cleared each time the Statement is executed.

Warnings associated with reads from the ResultSet returned from executing a Statement will be attached to the ResultSet, not the Statement object. an SQLWarning, null if there are no warnings
throws:
  SQLException - if an error occurs accessing the database




setCursorName
public void setCursorName(String name) throws SQLException(Code)
Sets the SQL cursor name. This name is used by subsequent Statement execute methods.

Cursor names must be unique within one Connection.

With the Cursor name set, it can then be utilized in SQL positioned update or delete statements to determine the current row in a ResultSet generated from this Statement. The positioned update or delete must be done with a different Statement than this one.
Parameters:
  name - the Cursor name as a String,
throws:
  SQLException - if an error occurs accessing the database




setEscapeProcessing
public void setEscapeProcessing(boolean enable) throws SQLException(Code)
Sets Escape Processing mode.

If Escape Processing is on, the JDBC driver will do escape substitution on an SQL statement before sending it for execution. This does not apply to PreparedStatements since they are processed when created, before this method can be called.
Parameters:
  enable - true to set escape processing mode on, false to turn it off.
throws:
  SQLException - if an error occurs accessing the database




setFetchDirection
public void setFetchDirection(int direction) throws SQLException(Code)
Sets the fetch direction - a hint to the JDBC driver about the direction of processing of rows in ResultSets created by this Statement. The default fetch direction is FETCH_FORWARD.
Parameters:
  direction - which fetch direction to use. This parameter should be one ofResultSet.FETCH_UNKNOWN, ResultSet.FETCH_FORWARD orResultSet.FETCH_REVERSE
throws:
  SQLException - if there is an error while accessing the database or if thefetch direction is unrecognized



setFetchSize
public void setFetchSize(int rows) throws SQLException(Code)
Sets the fetch size. This is a hint to the JDBC driver about how many rows should be fetched from the database when more are required by application processing.
Parameters:
  rows - the number of rows that should be fetched. 0 tells the driverto ignore the hint. Should be less thangetMaxRows for this statement. Should not benegative.
throws:
  SQLException - if an error occurs accessing the database, or if the rowsparameter is out of range.



setMaxFieldSize
public void setMaxFieldSize(int max) throws SQLException(Code)
Sets the maximum number of bytes for ResultSet columns that contain character or binary values. This applies to BINARY, VARBINARY, LONGVARBINARY, CHAR, VARCHAR, and LONGVARCHAR fields. Any data exceeding the maximum size is abandoned without announcement.
Parameters:
  max - the maximum field size in bytes. O means "no limit".
throws:
  SQLException - if an error occurs accessing the database or the max value is<0.



setMaxRows
public void setMaxRows(int max) throws SQLException(Code)
Sets the maximum number of rows that any ResultSet can contain. If the number of rows exceeds this value, the additional rows are silently discarded.
Parameters:
  max - the maximum number of rows. 0 means "no limit".
throws:
  SQLException - if an error occurs accessing the database or if max <0.



setQueryTimeout
public void setQueryTimeout(int seconds) throws SQLException(Code)
Sets the timeout, in seconds, for queries - how long the driver will allow for completion of a Statement execution. If the timeout is exceeded, the query will throw an SQLException.
Parameters:
  seconds - timeout in seconds. 0 means no timeout ("wait forever")
throws:
  SQLException - if an error occurs accessing the database or if seconds <0.



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