Java Doc for CallableStatement.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.CallableStatement

CallableStatement
public interface CallableStatement extends PreparedStatement(Code)
An interface used to call Stored Procedures.

The JDBC API provides an SQL escape syntax allowing Stored Procedures to be called in a standard way for all databases. The JDBC escape syntax has two forms. One form includes a result parameter. The second form does not include a result parameter. Where the result parameter is used, it must be declared as an OUT parameter. Other parameters can be declared as IN, OUT or INOUT. Parameters are referenced either by name or by a numerical index, with the first parameter being 1, the second 1 and so on. Here are examples of the two forms of the escape syntax: { ?= call <.procedurename>.[([parameter1,parameter2,...])]} {call <.procedurename>.[([parameter1,parameter2,...])]}

IN parameters are set before calling the procedure, using the setter methods which are inherited from PreparedStatement. For OUT parameters, their Type must be registered before executing the stored procedure, and the value is retrieved using the getter methods defined in the CallableStatement interface.

CallableStatements can return one or more ResultSets. Where multiple ResultSets are returned they are accessed using the methods inherited from the Statement interface.





Method Summary
public  ArraygetArray(int parameterIndex)
     Gets the value of a specified JDBC ARRAY parameter as a java.sql.Array.
public  ArraygetArray(String parameterName)
     Gets the value of a specified JDBC ARRAY parameter as a java.sql.Array.
public  BigDecimalgetBigDecimal(int parameterIndex)
     Returns a new BigDecimal representation of the JDBC NUMERIC parameter specified by the input index.
Parameters:
  parameterIndex - the parameter number index (starts from 1) a java.math.BigDecimal with the value of thespecified parameter.
public  BigDecimalgetBigDecimal(int parameterIndex, int scale)
     Returns a new BigDecimal representation of the JDBC NUMERIC parameter specified by the input index.
public  BigDecimalgetBigDecimal(String parameterName)
     Returns a new BigDecimal representation of the JDBC NUMERIC parameter specified by the input name.
public  BlobgetBlob(int parameterIndex)
     Gets the value of a specified JDBC BLOB parameter as a java.sql.Blob
Parameters:
  parameterIndex - the parameter number index, where the first parameter hasindex 1 a java.sql.Blob with the value.
public  BlobgetBlob(String parameterName)
     Gets the value of a specified JDBC BLOB parameter as a java.sql.Blob
Parameters:
  parameterName - the name of the parameter a java.sql.Blob with the value.
public  booleangetBoolean(int parameterIndex)
     Gets the value of a specified JDBC BIT parameter as a boolean
Parameters:
  parameterIndex - the parameter number index, where the first parameter hasindex 1 a boolean representing the parameter value.
public  booleangetBoolean(String parameterName)
     Gets the value of a specified JDBC BIT parameter as a boolean
Parameters:
  parameterName - the parameter of interest's name a boolean representation of the value of theparameter.
public  bytegetByte(int parameterIndex)
     Gets the value of a specified JDBC TINYINT parameter as a byte
Parameters:
  parameterIndex - the parameter number index, where the first parameter hasindex 1 a byte with the value of the parameter.
public  bytegetByte(String parameterName)
     Gets the value of a specified JDBC TINYINT parameter as a Java byte.
Parameters:
  parameterName - the parameter of interest's name a byte representation of the value of theparameter.
public  byte[]getBytes(int parameterIndex)
     Returns a byte array representation of the indexed JDBC BINARY or VARBINARY parameter.
Parameters:
  parameterIndex - the parameter number index, where the first parameter hasindex 1 an array of bytes with the value of the parameter.
public  byte[]getBytes(String parameterName)
     Returns a byte array representation of the named JDBC BINARY or VARBINARY parameter.
Parameters:
  parameterName - the name of the parameter an array of bytes with the value of the parameter.
public  ClobgetClob(int parameterIndex)
     Gets the value of a specified JDBC CLOB parameter as a java.sql.Clob
Parameters:
  parameterIndex - the parameter number index, where the first parameter hasindex 1 a java.sql.Clob with the value of the parameter.
public  ClobgetClob(String parameterName)
     Gets the value of a specified JDBC CLOB parameter as a java.sql.Clob
Parameters:
  parameterName - the name of the parameter a java.sql.Clob with the value of the parameter.
public  DategetDate(int parameterIndex)
     Gets the value of a specified JDBC DATE parameter as a java.sql.Date.
Parameters:
  parameterIndex - the parameter number index, where the first parameter hasindex 1 the java.sql.Date with the parameter value.
public  DategetDate(int parameterIndex, Calendar cal)
     Gets the value of a specified JDBC DATE parameter as a java.sql.Date., using a specified Calendar to construct the date.

The JDBC driver uses the Calendar to create the Date using a particular timezone and locale.

public  DategetDate(String parameterName)
     Gets the value of a specified JDBC DATE parameter as a java.sql.Date.
Parameters:
  parameterName - the name of the parameter the java.sql.Date with the parameter value.
public  DategetDate(String parameterName, Calendar cal)
     Gets the value of a specified JDBC DATE parameter as a java.sql.Date., using a specified Calendar to construct the date.

The JDBC driver uses the Calendar to create the Date using a particular timezone and locale.

public  doublegetDouble(int parameterIndex)
     Gets the value of a specified JDBC DOUBLE parameter as a double
Parameters:
  parameterIndex - the parameter number index, where the first parameter hasindex 1 the double with the parameter value.
public  doublegetDouble(String parameterName)
    
public  floatgetFloat(int parameterIndex)
     Gets the value of a specified JDBC FLOAT parameter as a float
Parameters:
  parameterIndex - the parameter number index, where the first parameter hasindex 1 the float with the parameter value.
public  floatgetFloat(String parameterName)
     Gets the value of a specified JDBC FLOAT parameter as a Java float.
public  intgetInt(int parameterIndex)
     Gets the value of a specified JDBC INTEGER parameter as an int
Parameters:
  parameterIndex - the parameter number index, where the first parameter hasindex 1 the int with the parameter value.
public  intgetInt(String parameterName)
     Gets the value of a specified JDBC INTEGER parameter as an int
Parameters:
  parameterName - the name of the parameter the int with the parameter value.
public  longgetLong(int parameterIndex)
     Gets the value of a specified JDBC BIGINT parameter as a long
Parameters:
  parameterIndex - the parameter number index, where the first parameter hasindex 1 the long with the parameter value.
public  longgetLong(String parameterName)
     Gets the value of a specified JDBC BIGINT parameter as a long
Parameters:
  parameterName - the name of the parameter the long with the parameter value.
public  ObjectgetObject(int parameterIndex)
     Gets the value of a specified parameter as a Java Object.

The object type returned is the JDBC type registered for the parameter with a registerOutParameter call.

public  ObjectgetObject(int parameterIndex, Map<String, Class<?>> map)
     Gets the value of a specified parameter as an Object.
public  ObjectgetObject(String parameterName)
     Gets the value of a specified parameter as an Object.

The object type returned is the JDBC type registered for the parameter with a registerOutParameter call.

public  ObjectgetObject(String parameterName, Map<String, Class<?>> map)
     Gets the value of a specified parameter as an Object.
public  RefgetRef(int parameterIndex)
     Gets the value of a specified JDBC REF() parameter as a java.sql.Ref
Parameters:
  parameterIndex - the parameter number index, where the first parameter hasindex 1 a java.sql.Ref with the parameter value.
public  RefgetRef(String parameterName)
     Gets the value of a specified JDBC REF() parameter as a java.sql.Ref
Parameters:
  parameterName - the parameter name the target parameter's value in the form of ajava.sql.Ref.
public  shortgetShort(int parameterIndex)
     Gets the value of a specified JDBC SMALLINT parameter as a short
Parameters:
  parameterIndex - the parameter number index, where the first parameter hasindex 1 a short with the parameter value.
public  shortgetShort(String parameterName)
    
public  StringgetString(int parameterIndex)
     Returns the indexed parameter's value as a string.
public  StringgetString(String parameterName)
     Returns the named parameter's value as a string.
public  TimegetTime(int parameterIndex)
     Gets the value of a specified JDBC TIME parameter as a java.sql.Time.
Parameters:
  parameterIndex - the parameter number index, where the first parameter hasindex 1 a java.sql.Time with the parameter value.
public  TimegetTime(int parameterIndex, Calendar cal)
     Gets the value of a specified JDBC TIME parameter as a java.sql.Time, using the supplied Calendar to construct the time.
public  TimegetTime(String parameterName)
     Gets the value of a specified JDBC TIME parameter as a
Parameters:
  parameterName - the parameter name a new java.sql.Time with the parameter value.
public  TimegetTime(String parameterName, Calendar cal)
     Gets the value of a specified JDBC TIME parameter as a java.sql.Time, using the supplied Calendar to construct the time.
public  TimestampgetTimestamp(int parameterIndex)
     Returns the indexed parameter's TIMESTAMP value as a java.sql.Timestamp.
public  TimestampgetTimestamp(int parameterIndex, Calendar cal)
     Returns the indexed parameter's TIMESTAMP value as a java.sql.Timestamp.
public  TimestampgetTimestamp(String parameterName)
     Returns the named parameter's TIMESTAMP value as a java.sql.Timestamp.
public  TimestampgetTimestamp(String parameterName, Calendar cal)
     Returns the indexed parameter's TIMESTAMP value as a java.sql.Timestamp.
public  URLgetURL(int parameterIndex)
     Gets the value of a specified JDBC DATALINK parameter as a java.net.URL.
Parameters:
  parameterIndex - the parameter number index, where the first parameter hasindex 1 a java.sql.Datalink with the parameter value.
public  URLgetURL(String parameterName)
     Returns the named parameter's JDBC DATALINK value in a new Java java.net.URL.
Parameters:
  parameterName - the parameter name a new java.net.URL encapsulating the parametervalue.
public  voidregisterOutParameter(int parameterIndex, int sqlType)
     Defines the Type of a specified OUT parameter.
public  voidregisterOutParameter(int parameterIndex, int sqlType, int scale)
     Defines the Type of a specified OUT parameter.
public  voidregisterOutParameter(int paramIndex, int sqlType, String typeName)
     Defines the Type of a specified OUT parameter.
public  voidregisterOutParameter(String parameterName, int sqlType)
     Defines the Type of a specified OUT parameter.
public  voidregisterOutParameter(String parameterName, int sqlType, int scale)
     Defines the Type of a specified OUT parameter.
public  voidregisterOutParameter(String parameterName, int sqlType, String typeName)
     Defines the Type of a specified OUT parameter.
public  voidsetAsciiStream(String parameterName, InputStream theInputStream, int length)
     Sets the value of a specified parameter to the content of a supplied InputStream, which has a specified number of bytes.

This is a good method for setting an SQL LONVARCHAR parameter where the length of the data is large.

public  voidsetBigDecimal(String parameterName, BigDecimal theBigDecimal)
     Sets the value of a specified parameter to a supplied java.math.BigDecimal value.
public  voidsetBinaryStream(String parameterName, InputStream theInputStream, int length)
     Sets the value of a specified parameter to the content of a supplied binary InputStream, which has a specified number of bytes.
public  voidsetBoolean(String parameterName, boolean theBoolean)
     Sets the value of a specified parameter to a supplied boolean value.
public  voidsetByte(String parameterName, byte theByte)
     Sets the value of a specified parameter to a supplied byte value.
public  voidsetBytes(String parameterName, byte[] theBytes)
     Sets the value of a specified parameter to a supplied array of bytes.
public  voidsetCharacterStream(String parameterName, Reader reader, int length)
     Sets the value of a specified parameter to the character content of a Reader object, with the specified length of character data.
public  voidsetDate(String parameterName, Date theDate)
     Sets the value of a specified parameter to a supplied java.sql.Date value.
public  voidsetDate(String parameterName, Date theDate, Calendar cal)
     Sets the value of a specified parameter to a supplied java.sql.Date value, using a supplied Calendar to map the Date.
public  voidsetDouble(String parameterName, double theDouble)
     Sets the value of a specified parameter to a supplied double value.
public  voidsetFloat(String parameterName, float theFloat)
     Sets the value of a specified parameter to to a supplied float value.
public  voidsetInt(String parameterName, int theInt)
     Sets the value of a specified parameter to a supplied int value.
public  voidsetLong(String parameterName, long theLong)
     Sets the value of a specified parameter to a supplied long value.
public  voidsetNull(String parameterName, int sqlType)
     Sets the value of a specified parameter to SQL NULL.
public  voidsetNull(String parameterName, int sqlType, String typeName)
     Sets the value of a specified parameter to be SQL NULL where the parameter type is either REF or user defined (e.g.
public  voidsetObject(String parameterName, Object theObject)
     Sets the value of a specified parameter using a supplied object.
public  voidsetObject(String parameterName, Object theObject, int targetSqlType)
     Sets the value of a specified parameter using a supplied object.

The Object is converted to the given targetSqlType before it is sent to the database.

public  voidsetObject(String parameterName, Object theObject, int targetSqlType, int scale)
     Sets the value of a specified parameter using a supplied object.

The Object is converted to the given targetSqlType before it is sent to the database.

public  voidsetShort(String parameterName, short theShort)
     Sets the value of a specified parameter to a supplied short value.
public  voidsetString(String parameterName, String theString)
     Sets the value of a specified parameter to a supplied String.
public  voidsetTime(String parameterName, Time theTime)
     Sets the value of the parameter named parameterName to the value of the supplied java.sql.Time.
public  voidsetTime(String parameterName, Time theTime, Calendar cal)
     Sets the value of the parameter named parameterName to the value of the supplied java.sql.Time using the supplied Calendar.
public  voidsetTimestamp(String parameterName, Timestamp theTimestamp)
     Sets the value of a specified parameter to a supplied java.sql.Timestamp value.
public  voidsetTimestamp(String parameterName, Timestamp theTimestamp, Calendar cal)
     Sets the value of a specified parameter to a supplied java.sql.Timestamp value, using the supplied Calendar.
public  voidsetURL(String parameterName, URL theURL)
     Sets the value of a specified parameter to the supplied java.net.URL.
public  booleanwasNull()
     Gets whether the value of the last OUT parameter read was SQL NULL.



Method Detail
getArray
public Array getArray(int parameterIndex) throws SQLException(Code)
Gets the value of a specified JDBC ARRAY parameter as a java.sql.Array.
Parameters:
  parameterIndex - the parameter number index, where the first parameter hasindex 1 a java.sql.Array containing the parameter value
throws:
  SQLException - if a database error happens



getArray
public Array getArray(String parameterName) throws SQLException(Code)
Gets the value of a specified JDBC ARRAY parameter as a java.sql.Array.
Parameters:
  parameterName - the parameter of interest's name a java.sql.Array containing the parameter value
throws:
  SQLException - if there is a problem accessing the database



getBigDecimal
public BigDecimal getBigDecimal(int parameterIndex) throws SQLException(Code)
Returns a new BigDecimal representation of the JDBC NUMERIC parameter specified by the input index.
Parameters:
  parameterIndex - the parameter number index (starts from 1) a java.math.BigDecimal with the value of thespecified parameter. The value null is returned ifthe parameter in question is an SQL NULL
throws:
  SQLException - if there is a problem accessing the database



getBigDecimal
public BigDecimal getBigDecimal(int parameterIndex, int scale) throws SQLException(Code)
Returns a new BigDecimal representation of the JDBC NUMERIC parameter specified by the input index. The number of digits after the decimal point is specified by scale.
Parameters:
  parameterIndex - the parameter number index, where the first parameter hasindex 1
Parameters:
  scale - the number of digits after the decimal point to get a java.math.BigDecimal with the value of thespecified parameter. The value null is returned ifthe parameter in question is an SQL NULL
throws:
  SQLException - if there is a problem accessing the database



getBigDecimal
public BigDecimal getBigDecimal(String parameterName) throws SQLException(Code)
Returns a new BigDecimal representation of the JDBC NUMERIC parameter specified by the input name.
Parameters:
  parameterName - the name of the parameter a java.math.BigDecimal with the value of the specified parameter.null if the value is SQL NULL.
throws:
  SQLException - if a database error happens



getBlob
public Blob getBlob(int parameterIndex) throws SQLException(Code)
Gets the value of a specified JDBC BLOB parameter as a java.sql.Blob
Parameters:
  parameterIndex - the parameter number index, where the first parameter hasindex 1 a java.sql.Blob with the value. null if the value is SQL NULL.
throws:
  SQLException - if a database error happens



getBlob
public Blob getBlob(String parameterName) throws SQLException(Code)
Gets the value of a specified JDBC BLOB parameter as a java.sql.Blob
Parameters:
  parameterName - the name of the parameter a java.sql.Blob with the value. null if the value is SQL NULL.
throws:
  SQLException - if a database error happens



getBoolean
public boolean getBoolean(int parameterIndex) throws SQLException(Code)
Gets the value of a specified JDBC BIT parameter as a boolean
Parameters:
  parameterIndex - the parameter number index, where the first parameter hasindex 1 a boolean representing the parameter value. false if the value isSQL NULL
throws:
  SQLException - if a database error happens



getBoolean
public boolean getBoolean(String parameterName) throws SQLException(Code)
Gets the value of a specified JDBC BIT parameter as a boolean
Parameters:
  parameterName - the parameter of interest's name a boolean representation of the value of theparameter. false is returned if the SQL value isNULL.
throws:
  SQLException - if there is a problem accessing the database



getByte
public byte getByte(int parameterIndex) throws SQLException(Code)
Gets the value of a specified JDBC TINYINT parameter as a byte
Parameters:
  parameterIndex - the parameter number index, where the first parameter hasindex 1 a byte with the value of the parameter. 0 if the value is SQLNULL.
throws:
  SQLException - if a database error happens



getByte
public byte getByte(String parameterName) throws SQLException(Code)
Gets the value of a specified JDBC TINYINT parameter as a Java byte.
Parameters:
  parameterName - the parameter of interest's name a byte representation of the value of theparameter. 0 is returned if the SQL value isNULL.
throws:
  SQLException - if there is a problem accessing the database



getBytes
public byte[] getBytes(int parameterIndex) throws SQLException(Code)
Returns a byte array representation of the indexed JDBC BINARY or VARBINARY parameter.
Parameters:
  parameterIndex - the parameter number index, where the first parameter hasindex 1 an array of bytes with the value of the parameter. null if thevalue is SQL NULL.
throws:
  SQLException - if there is a problem accessing the database



getBytes
public byte[] getBytes(String parameterName) throws SQLException(Code)
Returns a byte array representation of the named JDBC BINARY or VARBINARY parameter.
Parameters:
  parameterName - the name of the parameter an array of bytes with the value of the parameter. null if thevalue is SQL NULL.
throws:
  SQLException - if there is a problem accessing the database



getClob
public Clob getClob(int parameterIndex) throws SQLException(Code)
Gets the value of a specified JDBC CLOB parameter as a java.sql.Clob
Parameters:
  parameterIndex - the parameter number index, where the first parameter hasindex 1 a java.sql.Clob with the value of the parameter. null if thevalue is SQL NULL.
throws:
  SQLException - if a database error happens



getClob
public Clob getClob(String parameterName) throws SQLException(Code)
Gets the value of a specified JDBC CLOB parameter as a java.sql.Clob
Parameters:
  parameterName - the name of the parameter a java.sql.Clob with the value of the parameter. null if thevalue is SQL NULL.
throws:
  SQLException - if a database error happens



getDate
public Date getDate(int parameterIndex) throws SQLException(Code)
Gets the value of a specified JDBC DATE parameter as a java.sql.Date.
Parameters:
  parameterIndex - the parameter number index, where the first parameter hasindex 1 the java.sql.Date with the parameter value. null if the value isSQL NULL.
throws:
  SQLException - if a database error happens



getDate
public Date getDate(int parameterIndex, Calendar cal) throws SQLException(Code)
Gets the value of a specified JDBC DATE parameter as a java.sql.Date., using a specified Calendar to construct the date.

The JDBC driver uses the Calendar to create the Date using a particular timezone and locale. Default behaviour of the driver is to use the Java virtual machine default settings.
Parameters:
  parameterIndex - the parameter number index, where the first parameter hasindex 1
Parameters:
  cal - the Calendar to use to construct the Date the java.sql.Date with the parameter value. null if the value isSQL NULL.
throws:
  SQLException - if a database error happens




getDate
public Date getDate(String parameterName) throws SQLException(Code)
Gets the value of a specified JDBC DATE parameter as a java.sql.Date.
Parameters:
  parameterName - the name of the parameter the java.sql.Date with the parameter value. null if the value isSQL NULL.
throws:
  SQLException - if a database error happens



getDate
public Date getDate(String parameterName, Calendar cal) throws SQLException(Code)
Gets the value of a specified JDBC DATE parameter as a java.sql.Date., using a specified Calendar to construct the date.

The JDBC driver uses the Calendar to create the Date using a particular timezone and locale. Default behaviour of the driver is to use the Java virtual machine default settings.
Parameters:
  parameterName - the parameter name
Parameters:
  cal - used for creating the returned Date the java.sql.Date with the parameter value. null if the value isSQL NULL.
throws:
  SQLException - if a database error happens




getDouble
public double getDouble(int parameterIndex) throws SQLException(Code)
Gets the value of a specified JDBC DOUBLE parameter as a double
Parameters:
  parameterIndex - the parameter number index, where the first parameter hasindex 1 the double with the parameter value. 0.0 if the value is SQLNULL.
throws:
  SQLException - if a database error happens



getDouble
public double getDouble(String parameterName) throws SQLException(Code)
Gets the value of a specified JDBC DOUBLE parameter as a double
Parameters:
  parameterName - the parameter name the parameter value as represented in a Java double.An SQL value of NULL gets represented as0 (zero).
throws:
  SQLException - if there is a problem accessing the database



getFloat
public float getFloat(int parameterIndex) throws SQLException(Code)
Gets the value of a specified JDBC FLOAT parameter as a float
Parameters:
  parameterIndex - the parameter number index, where the first parameter hasindex 1 the float with the parameter value. 0.0 if the value is SQL NULL.
throws:
  SQLException - if a database error happens



getFloat
public float getFloat(String parameterName) throws SQLException(Code)
Gets the value of a specified JDBC FLOAT parameter as a Java float.
Parameters:
  parameterName - the parameter name the parameter value as represented in a Java float.An SQL value of NULL gets represented as0 (zero).
throws:
  SQLException - if there is a problem accessing the database



getInt
public int getInt(int parameterIndex) throws SQLException(Code)
Gets the value of a specified JDBC INTEGER parameter as an int
Parameters:
  parameterIndex - the parameter number index, where the first parameter hasindex 1 the int with the parameter value. 0 if the value is SQL NULL.
throws:
  SQLException - if a database error happens



getInt
public int getInt(String parameterName) throws SQLException(Code)
Gets the value of a specified JDBC INTEGER parameter as an int
Parameters:
  parameterName - the name of the parameter the int with the parameter value. 0 if the value is SQL NULL.
throws:
  SQLException - if a database error happens



getLong
public long getLong(int parameterIndex) throws SQLException(Code)
Gets the value of a specified JDBC BIGINT parameter as a long
Parameters:
  parameterIndex - the parameter number index, where the first parameter hasindex 1 the long with the parameter value. 0 if the value is SQL NULL.
throws:
  SQLException - if a database error happens



getLong
public long getLong(String parameterName) throws SQLException(Code)
Gets the value of a specified JDBC BIGINT parameter as a long
Parameters:
  parameterName - the name of the parameter the long with the parameter value. 0 if the value is SQL NULL.
throws:
  SQLException - if a database error happens



getObject
public Object getObject(int parameterIndex) throws SQLException(Code)
Gets the value of a specified parameter as a Java Object.

The object type returned is the JDBC type registered for the parameter with a registerOutParameter call. If a parameter was registered as a java.sql.Types.OTHER then it may hold abstract types that are particular to the connected database.
Parameters:
  parameterIndex - the parameter number index, where the first parameter hasindex 1 an Object holding the value of the parameter.
throws:
  SQLException - if there is a problem accessing the database




getObject
public Object getObject(int parameterIndex, Map<String, Class<?>> map) throws SQLException(Code)
Gets the value of a specified parameter as an Object. A Map is supplied to provide custom mapping of the parameter value.
Parameters:
  parameterIndex - the parameter number index, where the first parameter hasindex 1
Parameters:
  map - the Map holing the mapping from SQL types to Java classes an Object holding the value of the parameter.
throws:
  SQLException - if a database error happens



getObject
public Object getObject(String parameterName) throws SQLException(Code)
Gets the value of a specified parameter as an Object.

The object type returned is the JDBC type registered for the parameter with a registerOutParameter call. If a parameter was registered as a java.sql.Types.OTHER then it may hold abstract types that are particular to the connected database.
Parameters:
  parameterName - the parameter name the Java Object representation of the value of theparameter.
throws:
  SQLException - if there is a problem accessing the database




getObject
public Object getObject(String parameterName, Map<String, Class<?>> map) throws SQLException(Code)
Gets the value of a specified parameter as an Object. A Map is supplied to provide custom mapping of the parameter value.
Parameters:
  parameterName - the parameter name
Parameters:
  map - the Map of SQL types to their Java counterparts an Object holding the value of the parameter.
throws:
  SQLException - if there is a problem accessing the database



getRef
public Ref getRef(int parameterIndex) throws SQLException(Code)
Gets the value of a specified JDBC REF() parameter as a java.sql.Ref
Parameters:
  parameterIndex - the parameter number index, where the first parameter hasindex 1 a java.sql.Ref with the parameter value. null if the value is SQLNULL.
throws:
  SQLException - if a database error happens



getRef
public Ref getRef(String parameterName) throws SQLException(Code)
Gets the value of a specified JDBC REF() parameter as a java.sql.Ref
Parameters:
  parameterName - the parameter name the target parameter's value in the form of ajava.sql.Ref. A null reference isreturned for a parameter value of SQL NULL.
throws:
  SQLException - if there is a problem accessing the database



getShort
public short getShort(int parameterIndex) throws SQLException(Code)
Gets the value of a specified JDBC SMALLINT parameter as a short
Parameters:
  parameterIndex - the parameter number index, where the first parameter hasindex 1 a short with the parameter value. 0 if the value is SQL NULL.
throws:
  SQLException - if a database error happens



getShort
public short getShort(String parameterName) throws SQLException(Code)
Gets the value of a specified JDBC SMALLINT parameter as a short
Parameters:
  parameterName - the parameter name the value of the target parameter as a Java short.If the value is an SQL NULL then 0(zero) is returned.
throws:
  SQLException - if there is a problem accessing the database



getString
public String getString(int parameterIndex) throws SQLException(Code)
Returns the indexed parameter's value as a string. The parameter value must be one of the JDBC types CHAR, VARCHAR or LONGVARCHAR.

The string corresponding to a CHAR of fixed length will be of identical length to the value in the database inclusive of padding characters.
Parameters:
  parameterIndex - the parameter number index, where the first parameter hasindex 1 a String with the parameter value. null if the value is SQL NULL.
throws:
  SQLException - if there is a problem accessing the database




getString
public String getString(String parameterName) throws SQLException(Code)
Returns the named parameter's value as a string. The parameter value must be one of the JDBC types CHAR, VARCHAR or LONGVARCHAR.

The string corresponding to a CHAR of fixed length will be of identical length to the value in the database inclusive of padding characters.
Parameters:
  parameterName - the parameter name a String with the parameter value. null if the value is SQL NULL.
throws:
  SQLException - if there is a problem accessing the database




getTime
public Time getTime(int parameterIndex) throws SQLException(Code)
Gets the value of a specified JDBC TIME parameter as a java.sql.Time.
Parameters:
  parameterIndex - the parameter number index, where the first parameter hasindex 1 a java.sql.Time with the parameter value. null if the value isSQL NULL.
throws:
  SQLException - if a database error happens



getTime
public Time getTime(int parameterIndex, Calendar cal) throws SQLException(Code)
Gets the value of a specified JDBC TIME parameter as a java.sql.Time, using the supplied Calendar to construct the time. The JDBC driver uses the Calendar to handle specific timezones and locales when creating the Time.
Parameters:
  parameterIndex - the parameter number index, where the first parameter hasindex 1
Parameters:
  cal - the Calendar to use in constructing the Time. a java.sql.Time with the parameter value. null if the value isSQL NULL.
throws:
  SQLException - if a database error happens



getTime
public Time getTime(String parameterName) throws SQLException(Code)
Gets the value of a specified JDBC TIME parameter as a
Parameters:
  parameterName - the parameter name a new java.sql.Time with the parameter value. Anull reference is returned for an SQL value ofNULL
throws:
  SQLException - if a database error happens



getTime
public Time getTime(String parameterName, Calendar cal) throws SQLException(Code)
Gets the value of a specified JDBC TIME parameter as a java.sql.Time, using the supplied Calendar to construct the time. The JDBC driver uses the Calendar to handle specific timezones and locales when creating the Time.
Parameters:
  parameterName - the parameter name
Parameters:
  cal - used for creating the returned Time a java.sql.Time with the parameter value. Anull reference is returned for an SQL value ofNULL
throws:
  SQLException - if a database error happens



getTimestamp
public Timestamp getTimestamp(int parameterIndex) throws SQLException(Code)
Returns the indexed parameter's TIMESTAMP value as a java.sql.Timestamp.
Parameters:
  parameterIndex - the parameter number index, where the first parameter hasindex 1 a new java.sql.Timestamp with the parameter value.A null reference is returned for an SQL value ofNULL
throws:
  SQLException - if a database error happens



getTimestamp
public Timestamp getTimestamp(int parameterIndex, Calendar cal) throws SQLException(Code)
Returns the indexed parameter's TIMESTAMP value as a java.sql.Timestamp. The JDBC driver uses the supplied Calendar to handle specific timezones and locales when creating the result.
Parameters:
  parameterIndex - the parameter number index, where the first parameter hasindex 1
Parameters:
  cal - used for creating the returned Timestamp a new java.sql.Timestamp with the parameter value.A null reference is returned for an SQL value ofNULL
throws:
  SQLException - if a database error happens



getTimestamp
public Timestamp getTimestamp(String parameterName) throws SQLException(Code)
Returns the named parameter's TIMESTAMP value as a java.sql.Timestamp.
Parameters:
  parameterName - the parameter name a new java.sql.Timestamp with the parameter value.A null reference is returned for an SQL value ofNULL
throws:
  SQLException - if a database error happens



getTimestamp
public Timestamp getTimestamp(String parameterName, Calendar cal) throws SQLException(Code)
Returns the indexed parameter's TIMESTAMP value as a java.sql.Timestamp. The JDBC driver uses the supplied Calendar to handle specific timezones and locales when creating the result.
Parameters:
  parameterName - the parameter name
Parameters:
  cal - used for creating the returned Timestamp a new java.sql.Timestamp with the parameter value.A null reference is returned for an SQL value ofNULL
throws:
  SQLException - if a database error happens



getURL
public URL getURL(int parameterIndex) throws SQLException(Code)
Gets the value of a specified JDBC DATALINK parameter as a java.net.URL.
Parameters:
  parameterIndex - the parameter number index, where the first parameter hasindex 1 a java.sql.Datalink with the parameter value. null if the valueis SQL NULL.
throws:
  SQLException - if a database error happens



getURL
public URL getURL(String parameterName) throws SQLException(Code)
Returns the named parameter's JDBC DATALINK value in a new Java java.net.URL.
Parameters:
  parameterName - the parameter name a new java.net.URL encapsulating the parametervalue. A null reference is returned for an SQLvalue of NULL
throws:
  SQLException - if a database error happens



registerOutParameter
public void registerOutParameter(int parameterIndex, int sqlType) throws SQLException(Code)
Defines the Type of a specified OUT parameter. All OUT parameters must have their Type defined before a stored procedure is executed.

The Type defined by this method fixes the Java type that must be retrieved using the getter methods of CallableStatement. If a database specific type is expected for a parameter, the Type java.sql.Types.OTHER should be used. Note that there is another variant of this method for User Defined Types or a REF type.
Parameters:
  parameterIndex - the parameter number index, where the first parameter hasindex 1
Parameters:
  sqlType - the JDBC type as defined by java.sql.Types. The JDBC typesNUMERIC and DECIMAL should be defined using the version ofregisterOutParameter that takes ascale parameter.
throws:
  SQLException - if a database error happens




registerOutParameter
public void registerOutParameter(int parameterIndex, int sqlType, int scale) throws SQLException(Code)
Defines the Type of a specified OUT parameter. All OUT parameters must have their Type defined before a stored procedure is executed. This version of the registerOutParameter method, which has a scale parameter, should be used for the JDBC types NUMERIC and DECIMAL, where there is a need to specify the number of digits expected after the decimal point.

The Type defined by this method fixes the Java type that must be retrieved using the getter methods of CallableStatement.
Parameters:
  parameterIndex - the parameter number index, where the first parameter hasindex 1
Parameters:
  sqlType - the JDBC type as defined by java.sql.Types.
Parameters:
  scale - the number of digits after the decimal point. Must be greaterthan or equal to 0.
throws:
  SQLException - if a database error happens




registerOutParameter
public void registerOutParameter(int paramIndex, int sqlType, String typeName) throws SQLException(Code)
Defines the Type of a specified OUT parameter. This variant of the method is designed for use with parameters that are User Defined Types (UDT) or a REF type, although it can be used for any type.
Parameters:
  paramIndex - the parameter number index, where the first parameter hasindex 1
Parameters:
  sqlType - a JDBC type expressed as a constant from Types
Parameters:
  typeName - an SQL type name. For a REF type, this name should be thefully qualified name of the referenced type.
throws:
  SQLException - if a database error happens



registerOutParameter
public void registerOutParameter(String parameterName, int sqlType) throws SQLException(Code)
Defines the Type of a specified OUT parameter. All OUT parameters must have their Type defined before a stored procedure is executed.

The Type defined by this method fixes the Java type that must be retrieved using the getter methods of CallableStatement. If a database specific type is expected for a parameter, the Type java.sql.Types.OTHER should be used. Note that there is another variant of this method for User Defined Types or a REF type.
Parameters:
  parameterName - the parameter name
Parameters:
  sqlType - a JDBC type expressed as a constant from Types. TypesNUMERIC and DECIMAL should be defined using the variant ofthis method that takes a scale parameter.
throws:
  SQLException - if a database error happens




registerOutParameter
public void registerOutParameter(String parameterName, int sqlType, int scale) throws SQLException(Code)
Defines the Type of a specified OUT parameter. All OUT parameters must have their Type defined before a stored procedure is executed. This version of the registerOutParameter method, which has a scale parameter, should be used for the JDBC types NUMERIC and DECIMAL, where there is a need to specify the number of digits expected after the decimal point.

The Type defined by this method fixes the Java type that must be retrieved using the getter methods of CallableStatement.
Parameters:
  parameterName - the parameter name
Parameters:
  sqlType - a JDBC type expressed as a constant from Types
Parameters:
  scale - the number of digits after the decimal point. Must be greaterthan or equal to 0.
throws:
  SQLException - if a database error happens




registerOutParameter
public void registerOutParameter(String parameterName, int sqlType, String typeName) throws SQLException(Code)
Defines the Type of a specified OUT parameter. This variant of the method is designed for use with parameters that are User Defined Types (UDT) or a REF type, although it can be used for any type.Registers the designated output parameter.
Parameters:
  parameterName - the parameter name
Parameters:
  sqlType - a JDBC type expressed as a constant from Types
Parameters:
  typeName - the fully qualified name of an SQL structured type. For a REFtype, this name should be the fully qualified name of thereferenced type.
throws:
  SQLException - if a database error happens



setAsciiStream
public void setAsciiStream(String parameterName, InputStream theInputStream, int length) throws SQLException(Code)
Sets the value of a specified parameter to the content of a supplied InputStream, which has a specified number of bytes.

This is a good method for setting an SQL LONVARCHAR parameter where the length of the data is large. Data is read from the InputStream until end-of-file is reached or the specified number of bytes is copied.
Parameters:
  parameterName - the parameter name
Parameters:
  theInputStream - the ASCII InputStream carrying the data to update theparameter with
Parameters:
  length - the number of bytes in the InputStream to copy to theparameter
throws:
  SQLException - if a database error happens




setBigDecimal
public void setBigDecimal(String parameterName, BigDecimal theBigDecimal) throws SQLException(Code)
Sets the value of a specified parameter to a supplied java.math.BigDecimal value.
Parameters:
  parameterName - the name of the parameter
Parameters:
  theBigDecimal - the java.math.BigInteger value to set
throws:
  SQLException - if a database error happens



setBinaryStream
public void setBinaryStream(String parameterName, InputStream theInputStream, int length) throws SQLException(Code)
Sets the value of a specified parameter to the content of a supplied binary InputStream, which has a specified number of bytes.

Use this method when a large amount of data needs to be set into a LONGVARBINARY parameter.
Parameters:
  parameterName - the name of the parameter
Parameters:
  theInputStream - the binary InputStream carrying the data to update theparameter
Parameters:
  length - the number of bytes in the InputStream to copy to theparameter
throws:
  SQLException - if a database error happens




setBoolean
public void setBoolean(String parameterName, boolean theBoolean) throws SQLException(Code)
Sets the value of a specified parameter to a supplied boolean value.
Parameters:
  parameterName - the parameter name
Parameters:
  theBoolean - the new value with which to update the parameter
throws:
  SQLException - if a database error happens



setByte
public void setByte(String parameterName, byte theByte) throws SQLException(Code)
Sets the value of a specified parameter to a supplied byte value.
Parameters:
  parameterName - the parameter name
Parameters:
  theByte - the new value with which to update the parameter
throws:
  SQLException - if a database error happens



setBytes
public void setBytes(String parameterName, byte[] theBytes) throws SQLException(Code)
Sets the value of a specified parameter to a supplied array of bytes. The array is mapped to VARBINARY or else LONGVARBINARY in the connected database.
Parameters:
  parameterName - the parameter name
Parameters:
  theBytes - the new value with which to update the parameter
throws:
  SQLException - if a database error happens



setCharacterStream
public void setCharacterStream(String parameterName, Reader reader, int length) throws SQLException(Code)
Sets the value of a specified parameter to the character content of a Reader object, with the specified length of character data.
Parameters:
  parameterName - the parameter name
Parameters:
  reader - the new value with which to update the parameter
Parameters:
  length - a count of the characters contained in reader
throws:
  SQLException - if a database error happens



setDate
public void setDate(String parameterName, Date theDate) throws SQLException(Code)
Sets the value of a specified parameter to a supplied java.sql.Date value.
Parameters:
  parameterName - the parameter name
Parameters:
  theDate - the new value with which to update the parameter
throws:
  SQLException - if a database error happens



setDate
public void setDate(String parameterName, Date theDate, Calendar cal) throws SQLException(Code)
Sets the value of a specified parameter to a supplied java.sql.Date value, using a supplied Calendar to map the Date. The Calendar allows the application to control the timezone used to compute the SQL DATE in the database - without the supplied Calendar, the driver uses the default timezone of the Java virtual machine.
Parameters:
  parameterName - the parameter name
Parameters:
  theDate - the new value with which to update the parameter
Parameters:
  cal - a Calendar to use to construct the SQL DATE value
throws:
  SQLException - if a database error happens



setDouble
public void setDouble(String parameterName, double theDouble) throws SQLException(Code)
Sets the value of a specified parameter to a supplied double value.
Parameters:
  parameterName - the parameter name
Parameters:
  theDouble - the new value with which to update the parameter
throws:
  SQLException - if a database error happens



setFloat
public void setFloat(String parameterName, float theFloat) throws SQLException(Code)
Sets the value of a specified parameter to to a supplied float value.
Parameters:
  parameterName - the parameter name
Parameters:
  theFloat - the new value with which to update the parameter
throws:
  SQLException - if a database error happens



setInt
public void setInt(String parameterName, int theInt) throws SQLException(Code)
Sets the value of a specified parameter to a supplied int value.
Parameters:
  parameterName - the parameter name
Parameters:
  theInt - the new value with which to update the parameter
throws:
  SQLException - if a database error happens



setLong
public void setLong(String parameterName, long theLong) throws SQLException(Code)
Sets the value of a specified parameter to a supplied long value.
Parameters:
  parameterName - the parameter name
Parameters:
  theLong - the new value with which to update the parameter
throws:
  SQLException - if a database error happens



setNull
public void setNull(String parameterName, int sqlType) throws SQLException(Code)
Sets the value of a specified parameter to SQL NULL. Don't use this version of setNull for User Defined Types or for REF type parameters.
Parameters:
  parameterName - the parameter name
Parameters:
  sqlType - a JDBC type expressed as a constant from Types
throws:
  SQLException - if a database error happens



setNull
public void setNull(String parameterName, int sqlType, String typeName) throws SQLException(Code)
Sets the value of a specified parameter to be SQL NULL where the parameter type is either REF or user defined (e.g. STRUCT, JAVA_OBJECT etc).

For reasons of portability, the caller is expected to supply both the SQL Type code and Type name (which is just the parameter name if the type is user defined, or the name of the type being referenced if a REF).
Parameters:
  parameterName - the parameter name
Parameters:
  sqlType - a JDBC type expressed as a constant from Types
Parameters:
  typeName - if the target parameter is a user defined type then thisshould contain the full type namethe fully qualified name of a UDT or REF type - ignored if the parameteris not a UDT.
throws:
  SQLException - if a database error happens




setObject
public void setObject(String parameterName, Object theObject) throws SQLException(Code)
Sets the value of a specified parameter using a supplied object. Prior to issuing this request to the connected database theObject is transformed to the corresponding SQL type according to the normal Java to SQL mapping rules.

If the object's class implements the interface SQLData, the JDBC driver calls SQLData.writeSQL to write it to the SQL data stream. If theObject implements any of the following interfaces then it is the role of the driver to flow the value to the connected database using the appropriate SQL type :


Parameters:
  parameterName - the parameter name
Parameters:
  theObject - the new value with which to update the parameter
throws:
  SQLException - if a database error happens



setObject
public void setObject(String parameterName, Object theObject, int targetSqlType) throws SQLException(Code)
Sets the value of a specified parameter using a supplied object.

The Object is converted to the given targetSqlType before it is sent to the database. If the object has a custom mapping (its class implements the interface SQLData), the JDBC driver will call the method SQLData.writeSQL to write it to the SQL data stream. If theObject implements any of the following interfaces then it is the role of the driver to flow the value to the connected database using the appropriate SQL type :


Parameters:
  parameterName - the parameter name
Parameters:
  theObject - the new value with which to update the parameter
Parameters:
  targetSqlType - a JDBC type expressed as a constant from Types
throws:
  SQLException - if a database error happens



setObject
public void setObject(String parameterName, Object theObject, int targetSqlType, int scale) throws SQLException(Code)
Sets the value of a specified parameter using a supplied object.

The Object is converted to the given targetSqlType before it is sent to the database. If the object has a custom mapping (its class implements the interface SQLData), the JDBC driver will call the method SQLData.writeSQL to write it to the SQL data stream. If theObject implements any of the following interfaces then it is the role of the driver to flow the value to the connected database using the appropriate SQL type :


Parameters:
  parameterName - the parameter name
Parameters:
  theObject - the new value with which to update the parameter
Parameters:
  targetSqlType - a JDBC type expressed as a constant from Types
Parameters:
  scale - where applicable, the number of digits after the decimalpoint.
throws:
  SQLException - if a database error happens



setShort
public void setShort(String parameterName, short theShort) throws SQLException(Code)
Sets the value of a specified parameter to a supplied short value.
Parameters:
  parameterName - the name of the parameter
Parameters:
  theShort - a short value to update the parameter
throws:
  SQLException - if a database error happens



setString
public void setString(String parameterName, String theString) throws SQLException(Code)
Sets the value of a specified parameter to a supplied String.
Parameters:
  parameterName - the name of the parameter
Parameters:
  theString - a String value to update the parameter
throws:
  SQLException - if a database error happens



setTime
public void setTime(String parameterName, Time theTime) throws SQLException(Code)
Sets the value of the parameter named parameterName to the value of the supplied java.sql.Time.
Parameters:
  parameterName - the parameter name
Parameters:
  theTime - the new value with which to update the parameter
throws:
  SQLException - if a database error happens



setTime
public void setTime(String parameterName, Time theTime, Calendar cal) throws SQLException(Code)
Sets the value of the parameter named parameterName to the value of the supplied java.sql.Time using the supplied Calendar.

The driver uses the supplied Calendar to create the SQL TIME value, which allows it to use a custom timezone - otherwise the driver uses the default timezone of the Java virtual machine.
Parameters:
  parameterName - the parameter name
Parameters:
  theTime - the new value with which to update the parameter
Parameters:
  cal - used for creating the new SQL TIME value
throws:
  SQLException - if a database error happens




setTimestamp
public void setTimestamp(String parameterName, Timestamp theTimestamp) throws SQLException(Code)
Sets the value of a specified parameter to a supplied java.sql.Timestamp value.
Parameters:
  parameterName - the parameter name
Parameters:
  theTimestamp - the new value with which to update the parameter
throws:
  SQLException - if a database error happens



setTimestamp
public void setTimestamp(String parameterName, Timestamp theTimestamp, Calendar cal) throws SQLException(Code)
Sets the value of a specified parameter to a supplied java.sql.Timestamp value, using the supplied Calendar.

The driver uses the supplied Calendar to create the SQL TIMESTAMP value, which allows it to use a custom timezone - otherwise the driver uses the default timezone of the Java virtual machine.
Parameters:
  parameterName - the parameter name
Parameters:
  theTimestamp - the new value with which to update the parameter
Parameters:
  cal - used for creating the new SQL TIME value
throws:
  SQLException - if a database error happens




setURL
public void setURL(String parameterName, URL theURL) throws SQLException(Code)
Sets the value of a specified parameter to the supplied java.net.URL.
Parameters:
  parameterName - the parameter name
Parameters:
  theURL - the new value with which to update the parameter
throws:
  SQLException - if a database error happens



wasNull
public boolean wasNull() throws SQLException(Code)
Gets whether the value of the last OUT parameter read was SQL NULL. true if the last parameter was SQL NULL, false otherwise.
throws:
  SQLException - if a database error happens



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