11.2.2 getParameterClassName(int param)
- Organization of this subsection
(1) Function
This method acquires the fully specified Java class name for the data type of a parameter.
(2) Format
public synchronized String getParameterClassName(int param) throws SQLException
(3) Arguments
- int param
-
Specifies a parameter number (beginning with 1).
(4) Return value
The method returns a String object.
This method returns the String Java class type that is used by the setObject method of the PreparedStatement object for the parameter. The following table shows the parameter data types and corresponding return values.
Parameter's data type (HADB data type) |
Character string returned |
---|---|
INTEGER |
"java.lang.Long" |
SMALLINT |
"java.lang.Integer" |
DOUBLE PRECISION |
"java.lang.Double" |
DECIMAL |
"java.math.BigDecimal" |
CHAR |
"java.lang.String" |
VARCHAR |
"java.lang.String" |
DATE |
"java.sql.Date" |
TIME |
"java.sql.Time" |
TIMESTAMP |
"java.sql.Timestamp" |
BINARY |
"java.lang.Object" |
VARBINARY |
"java.lang.Object" |
ROW |
"java.sql.Object" |
(5) Exceptions
If the specified param value is 0 or less, or is greater than the number of parameters, the JDBC driver throws an SQLException.