Java Doc for PreparedStatement_base.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
      com.internetcds.jdbc.tds.PreparedStatement_base

All known Subclasses:   com.internetcds.jdbc.tds.PreparedStatement_2_0,  com.internetcds.jdbc.tds.CallableStatement_base,
PreparedStatement_base
public class PreparedStatement_base extends com.internetcds.jdbc.tds.Statement implements PreparedStatementHelper(Code)

A SQL statement is pre-compiled and stored in a PreparedStatement object. This object can then be used to efficiently execute this statement multiple times.

Note: The setXXX methods for setting IN parameter values must specify types that are compatible with the defined SQL type of the input parameter. For instance, if the IN parameter has SQL type Integer then setInt should be used.

If arbitrary parameter type conversions are required then the setObject method should be used with a target SQL type.
author:
   Craig Spannring
author:
   The FreeTDS project
version:
   $Id: PreparedStatement_base.java,v 1.2 2007-10-19 13:21:40 sinisa Exp $
See Also:   Connection.prepareStatement
See Also:   ResultSet



Field Summary
final public static  StringcvsVersion
    
 ParameterListItem[]parameterList
    
 VectorprocedureCache
    
 StringrawQueryString
    

Constructor Summary
public  PreparedStatement_base(java.sql.Connection conn_, Tds tds_, String sql)
    

Method Summary
protected  voidNotImplemented()
    
public  voidclearParameters()
    

In general, parameter values remain in force for repeated use of a Statement.

public  voiddropAllProcedures()
    
public  booleanexecute()
     Some prepared statements return multiple results; the execute method handles these complex statements as well as the simpler form of statements handled by executeQuery and executeUpdate.
protected  booleanexecuteCall(String name, ParameterListItem[] formalParameterList, ParameterListItem[] actualParameterList)
    
public  java.sql.ResultSetexecuteQuery()
     A prepared SQL query is executed and its ResultSet is returned.
public  intexecuteUpdate()
     Execute a SQL INSERT, UPDATE or DELETE statement.
public static  voidmain(String args)
    
public  voidsetAsciiStream(int parameterIndex, java.io.InputStream x, int length)
     When a very large ASCII value is input to a LONGVARCHAR parameter, it may be more practical to send it via a java.io.InputStream.
public  voidsetBigDecimal(int parameterIndex, BigDecimal x)
     Set a parameter to a java.lang.BigDecimal value.
public  voidsetBinaryStream(int parameterIndex, java.io.InputStream x, int length)
     When a very large binary value is input to a LONGVARBINARY parameter, it may be more practical to send it via a java.io.InputStream.
public  voidsetBoolean(int parameterIndex, boolean x)
     Set a parameter to a Java boolean value.
public  voidsetByte(int index, byte x)
     Set a parameter to a Java byte value.
public  voidsetBytes(int parameterIndex, byte x)
     Set a parameter to a Java array of bytes.
public  voidsetDate(int parameterIndex, java.sql.Date value)
     Set a parameter to a java.sql.Date value.
public  voidsetDouble(int parameterIndex, double value)
     Set a parameter to a Java double value.
public  voidsetFloat(int parameterIndex, float value)
     Set a parameter to a Java float value.
public  voidsetInt(int index, int value)
     Set a parameter to a Java int value.
public  voidsetLong(int parameterIndex, long value)
     Set a parameter to a Java long value.
public  voidsetNull(int index, int type)
     Set a parameter to SQL NULL.
public  voidsetObject(int parameterIndex, Object x)
    

Set the value of a parameter using an object; use the java.lang equivalent objects for integral values.

The JDBC specification specifies a standard mapping from Java Object types to SQL types.

public  voidsetObject(int parameterIndex, Object x, int targetSqlType)
     This method is like setObject above, but assumes a scale of zero.
public  voidsetObject(int parameterIndex, Object x, int targetSqlType, int scale)
    

Set the value of a parameter using an object; use the java.lang equivalent objects for integral values.

The given Java object will be converted to the targetSqlType before being sent to the database.

Note that this method may be used to pass datatabase- specific abstract data types.

public  voidsetShort(int index, short value)
     Set a parameter to a Java short value.
public  voidsetString(int index, String str)
     Set a parameter to a Java String value.
public  voidsetTime(int parameterIndex, java.sql.Time x)
     Set a parameter to a java.sql.Time value.
public  voidsetTimestamp(int index, java.sql.Timestamp value)
     Set a parameter to a java.sql.Timestamp value.
public  voidsetUnicodeStream(int parameterIndex, java.io.InputStream x, int length)
     When a very large UNICODE value is input to a LONGVARCHAR parameter, it may be more practical to send it via a java.io.InputStream.

Field Detail
cvsVersion
final public static String cvsVersion(Code)



parameterList
ParameterListItem[] parameterList(Code)



procedureCache
Vector procedureCache(Code)



rawQueryString
String rawQueryString(Code)




Constructor Detail
PreparedStatement_base
public PreparedStatement_base(java.sql.Connection conn_, Tds tds_, String sql) throws SQLException(Code)




Method Detail
NotImplemented
protected void NotImplemented() throws java.sql.SQLException(Code)



clearParameters
public void clearParameters() throws SQLException(Code)

In general, parameter values remain in force for repeated use of a Statement. Setting a parameter value automatically clears its previous value. However, in some cases it is useful to immediately release the resources used by the current parameter values; this can be done by calling clearParameters.
exception:
  SQLException - if a database-access error occurs.




dropAllProcedures
public void dropAllProcedures()(Code)



execute
public boolean execute() throws SQLException(Code)
Some prepared statements return multiple results; the execute method handles these complex statements as well as the simpler form of statements handled by executeQuery and executeUpdate.
exception:
  SQLException - if a database-access error occurs.
See Also:   Statement.execute



executeCall
protected boolean executeCall(String name, ParameterListItem[] formalParameterList, ParameterListItem[] actualParameterList) throws SQLException(Code)



executeQuery
public java.sql.ResultSet executeQuery() throws SQLException(Code)
A prepared SQL query is executed and its ResultSet is returned. a ResultSet that contains the data produced by thequery; never null
exception:
  SQLException - if a database-access error occurs.



executeUpdate
public int executeUpdate() 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. either the row count for INSERT, UPDATE or DELETE; or 0for SQL statements that return nothing
exception:
  SQLException - if a database-access error occurs.



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



setAsciiStream
public void setAsciiStream(int parameterIndex, java.io.InputStream x, int length) throws SQLException(Code)
When a very large ASCII value is input to a LONGVARCHAR parameter, it may be more practical to send it via a java.io.InputStream. JDBC will read the data from the stream as needed, until it reaches end-of-file. The JDBC driver will do any necessary conversion from ASCII to the database char format.

Note: This stream object can either be a standard Java stream object or your own subclass that implements the standard interface.
Parameters:
  parameterIndex - the first parameter is 1, the second is 2, ...
Parameters:
  x - the java input stream which contains the ASCII parameter value
Parameters:
  length - the number of bytes in the stream
exception:
  SQLException - if a database-access error occurs.




setBigDecimal
public void setBigDecimal(int parameterIndex, BigDecimal x) throws SQLException(Code)
Set a parameter to a java.lang.BigDecimal value. The driver converts this to a SQL NUMERIC value when it sends it to the database.
Parameters:
  parameterIndex - the first parameter is 1, the second is 2, ...
Parameters:
  x - the parameter value
exception:
  SQLException - if a database-access error occurs.



setBinaryStream
public void setBinaryStream(int parameterIndex, java.io.InputStream x, int length) throws SQLException(Code)
When a very large binary value is input to a LONGVARBINARY parameter, it may be more practical to send it via a java.io.InputStream. JDBC will read the data from the stream as needed, until it reaches end-of-file.

Note: This stream object can either be a standard Java stream object or your own subclass that implements the standard interface.
Parameters:
  parameterIndex - the first parameter is 1, the second is 2, ...
Parameters:
  x - the java input stream which contains the binary parameter value
Parameters:
  length - the number of bytes in the stream
exception:
  SQLException - if a database-access error occurs.




setBoolean
public void setBoolean(int parameterIndex, boolean x) throws SQLException(Code)
Set a parameter to a Java boolean value. The driver converts this to a SQL BIT value when it sends it to the database.
Parameters:
  parameterIndex - the first parameter is 1, the second is 2, ...
Parameters:
  x - the parameter value
exception:
  SQLException - if a database-access error occurs.



setByte
public void setByte(int index, byte x) throws SQLException(Code)
Set a parameter to a Java byte value. The driver converts this to a SQL TINYINT value when it sends it to the database.
Parameters:
  parameterIndex - the first parameter is 1, the second is 2, ...
Parameters:
  x - the parameter value
exception:
  SQLException - if a database-access error occurs.



setBytes
public void setBytes(int parameterIndex, byte x) throws SQLException(Code)
Set a parameter to a Java array of bytes. The driver converts this to a SQL VARBINARY or LONGVARBINARY (depending on the argument's size relative to the driver's limits on VARBINARYs) when it sends it to the database.
Parameters:
  parameterIndex - the first parameter is 1, the second is 2, ...
Parameters:
  x - the parameter value
exception:
  SQLException - if a database-access error occurs.



setDate
public void setDate(int parameterIndex, java.sql.Date value) throws SQLException(Code)
Set a parameter to a java.sql.Date value. The driver converts this to a SQL DATE value when it sends it to the database.
Parameters:
  parameterIndex - the first parameter is 1, the second is 2, ...
Parameters:
  x - the parameter value
exception:
  SQLException - if a database-access error occurs.



setDouble
public void setDouble(int parameterIndex, double value) throws SQLException(Code)
Set a parameter to a Java double value. The driver converts this to a SQL DOUBLE value when it sends it to the database.
Parameters:
  parameterIndex - the first parameter is 1, the second is 2, ...
Parameters:
  x - the parameter value
exception:
  SQLException - if a database-access error occurs.



setFloat
public void setFloat(int parameterIndex, float value) throws SQLException(Code)
Set a parameter to a Java float value. The driver converts this to a SQL FLOAT value when it sends it to the database.
Parameters:
  parameterIndex - the first parameter is 1, the second is 2, ...
Parameters:
  x - the parameter value
exception:
  SQLException - if a database-access error occurs.



setInt
public void setInt(int index, int value) throws SQLException(Code)
Set a parameter to a Java int value. The driver converts this to a SQL INTEGER value when it sends it to the database.
Parameters:
  parameterIndex - the first parameter is 1, the second is 2, ...
Parameters:
  x - the parameter value
exception:
  SQLException - if a database-access error occurs.



setLong
public void setLong(int parameterIndex, long value) throws SQLException(Code)
Set a parameter to a Java long value. The driver converts this to a SQL BIGINT value when it sends it to the database.
Parameters:
  parameterIndex - the first parameter is 1, the second is 2, ...
Parameters:
  x - the parameter value
exception:
  SQLException - if a database-access error occurs.



setNull
public void setNull(int index, int type) throws SQLException(Code)
Set a parameter to SQL NULL.

Note: You must specify the parameter's SQL type.
Parameters:
  parameterIndex - the first parameter is 1, the second is 2, ...
Parameters:
  sqlType - SQL type code defined by java.sql.Types
exception:
  SQLException - if a database-access error occurs.




setObject
public void setObject(int parameterIndex, Object x) throws SQLException(Code)

Set the value of a parameter using an object; use the java.lang equivalent objects for integral values.

The JDBC specification specifies a standard mapping from Java Object types to SQL types. The given argument java object will be converted to the corresponding SQL type before being sent to the database.

Note that this method may be used to pass datatabase specific abstract data types, by using a Driver specific Java type.
Parameters:
  parameterIndex - The first parameter is 1, the second is 2, ...
Parameters:
  x - The object containing the input parameter value
exception:
  SQLException - if a database-access error occurs.




setObject
public void setObject(int parameterIndex, Object x, int targetSqlType) throws SQLException(Code)
This method is like setObject above, but assumes a scale of zero.
exception:
  SQLException - if a database-access error occurs.



setObject
public void setObject(int parameterIndex, Object x, int targetSqlType, int scale) throws SQLException(Code)

Set the value of a parameter using an object; use the java.lang equivalent objects for integral values.

The given Java object will be converted to the targetSqlType before being sent to the database.

Note that this method may be used to pass datatabase- specific abstract data types. This is done by using a Driver- specific Java type and using a targetSqlType of java.sql.types.OTHER.
Parameters:
  parameterIndex - The first parameter is 1, the second is 2, ...
Parameters:
  x - The object containing the input parameter value
Parameters:
  targetSqlType - The SQL type (as defined in java.sql.Types) to besent to the database. The scale argument may further qualify this type.
Parameters:
  scale - For java.sql.Types.DECIMAL or java.sql.Types.NUMERIC typesthis is the number of digits after the decimal. For all othertypes this value will be ignored,
exception:
  SQLException - if a database-access error occurs.
See Also:   Types




setShort
public void setShort(int index, short value) throws SQLException(Code)
Set a parameter to a Java short value. The driver converts this to a SQL SMALLINT value when it sends it to the database.
Parameters:
  parameterIndex - the first parameter is 1, the second is 2, ...
Parameters:
  x - the parameter value
exception:
  SQLException - if a database-access error occurs.



setString
public void setString(int index, String str) throws SQLException(Code)
Set a parameter to a Java String value. The driver converts this to a SQL VARCHAR or LONGVARCHAR value (depending on the arguments size relative to the driver's limits on VARCHARs) when it sends it to the database.
Parameters:
  parameterIndex - the first parameter is 1, the second is 2, ...
Parameters:
  x - the parameter value
exception:
  SQLException - if a database-access error occurs.



setTime
public void setTime(int parameterIndex, java.sql.Time x) throws SQLException(Code)
Set a parameter to a java.sql.Time value. The driver converts this to a SQL TIME value when it sends it to the database.
Parameters:
  parameterIndex - the first parameter is 1, the second is 2, ...
Parameters:
  x - the parameter value
exception:
  SQLException - if a database-access error occurs.



setTimestamp
public void setTimestamp(int index, java.sql.Timestamp value) throws SQLException(Code)
Set a parameter to a java.sql.Timestamp value. The driver converts this to a SQL TIMESTAMP value when it sends it to the database.
Parameters:
  parameterIndex - the first parameter is 1, the second is 2, ...
Parameters:
  x - the parameter value
exception:
  SQLException - if a database-access error occurs.



setUnicodeStream
public void setUnicodeStream(int parameterIndex, java.io.InputStream x, int length) throws SQLException(Code)
When a very large UNICODE value is input to a LONGVARCHAR parameter, it may be more practical to send it via a java.io.InputStream. JDBC will read the data from the stream as needed, until it reaches end-of-file. The JDBC driver will do any necessary conversion from UNICODE to the database char format.

Note: This stream object can either be a standard Java stream object or your own subclass that implements the standard interface.
Parameters:
  parameterIndex - the first parameter is 1, the second is 2, ...
Parameters:
  x - the java input stream which contains theUNICODE parameter value
Parameters:
  length - the number of bytes in the stream
exception:
  SQLException - if a database-access error occurs.




Fields inherited from com.internetcds.jdbc.tds.Statement
final public static String cvsVersion(Code)(Java Doc)
protected java.sql.ResultSet results(Code)(Java Doc)
protected Tds tds(Code)(Java Doc)
protected int timeout(Code)(Java Doc)
protected int updateCount(Code)(Java Doc)
protected SQLWarningChain warningChain(Code)(Java Doc)

Methods inherited from com.internetcds.jdbc.tds.Statement
public void addBatch(String sql) throws SQLException(Code)(Java Doc)
public void cancel() throws SQLException(Code)(Java Doc)
public void clearBatch() throws SQLException(Code)(Java Doc)
public void clearWarnings() throws SQLException(Code)(Java Doc)
public void close() throws SQLException(Code)(Java Doc)
protected void closeResults() throws java.sql.SQLException(Code)(Java Doc)
public void commit() throws java.sql.SQLException, java.io.IOException, com.internetcds.jdbc.tds.TdsUnknownPacketSubType, com.internetcds.jdbc.tds.TdsException(Code)(Java Doc)
public boolean execute(String sql) throws SQLException(Code)(Java Doc)
public boolean execute(String sql, int autoGeneratedKeys) throws SQLException(Code)(Java Doc)
public boolean execute(String sql, int[] columnIndexes) throws SQLException(Code)(Java Doc)
public boolean execute(String sql, String[] columnNames) throws SQLException(Code)(Java Doc)
public int[] executeBatch() throws SQLException(Code)(Java Doc)
public java.sql.ResultSet executeQuery(String sql) throws SQLException(Code)(Java Doc)
public int executeUpdate(String sql) throws SQLException(Code)(Java Doc)
public int executeUpdate(String sql, int autoGeneratedKeys) throws SQLException(Code)(Java Doc)
public int executeUpdate(String sql, int[] columnIndexes) throws SQLException(Code)(Java Doc)
public int executeUpdate(String sql, String[] columnNames) throws SQLException(Code)(Java Doc)
protected void finalize() throws Throwable(Code)(Java Doc)
public java.sql.Connection getConnection() throws SQLException(Code)(Java Doc)
public int getFetchDirection() throws SQLException(Code)(Java Doc)
public int getFetchSize() throws SQLException(Code)(Java Doc)
public ResultSet getGeneratedKeys() throws SQLException(Code)(Java Doc)
public int getMaxFieldSize() throws SQLException(Code)(Java Doc)
public int getMaxRows() throws SQLException(Code)(Java Doc)
public boolean getMoreResults() throws SQLException(Code)(Java Doc)
public boolean getMoreResults(int current) throws SQLException(Code)(Java Doc)
public int getQueryTimeout() throws SQLException(Code)(Java Doc)
public java.sql.ResultSet getResultSet() throws SQLException(Code)(Java Doc)
public int getResultSetConcurrency() throws SQLException(Code)(Java Doc)
public int getResultSetHoldability() throws SQLException(Code)(Java Doc)
public int getResultSetType() throws SQLException(Code)(Java Doc)
public int getUpdateCount() throws SQLException(Code)(Java Doc)
public SQLWarning getWarnings() throws SQLException(Code)(Java Doc)
public boolean isClosed()(Code)(Java Doc)
public boolean isPoolable() throws SQLException(Code)(Java Doc)
public boolean isWrapperFor(Class iface) throws SQLException(Code)(Java Doc)
public static void main(String args) throws java.lang.ClassNotFoundException, java.lang.IllegalAccessException, java.lang.InstantiationException, SQLException(Code)(Java Doc)
public void rollback() throws java.sql.SQLException, java.io.IOException, com.internetcds.jdbc.tds.TdsUnknownPacketSubType, com.internetcds.jdbc.tds.TdsException(Code)(Java Doc)
public void setCursorName(String name) throws SQLException(Code)(Java Doc)
public void setEscapeProcessing(boolean enable) throws SQLException(Code)(Java Doc)
public void setFetchDirection(int direction) throws SQLException(Code)(Java Doc)
public void setFetchSize(int rows) throws SQLException(Code)(Java Doc)
public void setMaxFieldSize(int max) throws SQLException(Code)(Java Doc)
public void setMaxRows(int max) throws SQLException(Code)(Java Doc)
public void setPoolable(boolean poolable) throws SQLException(Code)(Java Doc)
public void setQueryTimeout(int seconds) throws SQLException(Code)(Java Doc)
protected void startResultSet() throws SQLException(Code)(Java Doc)
public T unwrap(Class<T> iface) throws SQLException(Code)(Java Doc)

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

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