Class CallableParameterMetaData
- java.lang.Object
-
- org.mariadb.jdbc.CallableParameterMetaData
-
- All Implemented Interfaces:
java.sql.ParameterMetaData,java.sql.Wrapper
public class CallableParameterMetaData extends java.lang.Object implements java.sql.ParameterMetaDataCallable parameter metadata. Server doesn't give detailled information about parameter, so even if driver return those information, they are not completely accurate.
-
-
Field Summary
Fields Modifier and Type Field Description private booleanisFunctionprivate intparameterCountprivate java.sql.ResultSetrs
-
Constructor Summary
Constructors Constructor Description CallableParameterMetaData(java.sql.ResultSet rs, boolean isFunction)Constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.StringgetParameterClassName(int index)Retrieves the fully-qualified name of the Java class whose instances should be passed to the methodPreparedStatement.setObject.intgetParameterCount()Retrieves the number of parameters in thePreparedStatementobject for which thisParameterMetaDataobject contains information.intgetParameterMode(int index)Retrieves the designated parameter's mode.java.lang.StringgetParameterName(int index)Return the parameter name corresponding to index.intgetParameterType(int index)Retrieves the designated parameter's SQL type.java.lang.StringgetParameterTypeName(int index)Retrieves the designated parameter's database-specific type name.intgetPrecision(int index)Retrieves the designated parameter's specified column size.intgetScale(int index)Retrieves the designated parameter's number of digits to right of the decimal point.intisNullable(int index)Retrieves whether null values are allowed in the designated parameter.booleanisSigned(int index)Retrieves whether values for the designated parameter can be signed numbers.booleanisWrapperFor(java.lang.Class<?> iface)Returns true if this either implements the interface argument or is directly or indirectly a wrapper for an object that does.private voidsetIndex(int index)<T> Tunwrap(java.lang.Class<T> iface)Returns an object that implements the given interface to allow access to non-standard methods, or standard methods not exposed by the proxy.
-
-
-
Constructor Detail
-
CallableParameterMetaData
public CallableParameterMetaData(java.sql.ResultSet rs, boolean isFunction) throws java.sql.SQLExceptionConstructor- Parameters:
rs- parameter result-setisFunction- is command a function or a stored procedure- Throws:
java.sql.SQLException- if any error occurs
-
-
Method Detail
-
getParameterCount
public int getParameterCount()
Retrieves the number of parameters in thePreparedStatementobject for which thisParameterMetaDataobject contains information.- Specified by:
getParameterCountin interfacejava.sql.ParameterMetaData- Returns:
- the number of parameters
- Since:
- 1.4
-
isNullable
public int isNullable(int index) throws java.sql.SQLExceptionRetrieves whether null values are allowed in the designated parameter.- Specified by:
isNullablein interfacejava.sql.ParameterMetaData- Parameters:
index- the first parameter is 1, the second is 2, ...- Returns:
- the nullability status of the given parameter; one of
ParameterMetaData.parameterNoNulls,ParameterMetaData.parameterNullable, orParameterMetaData.parameterNullableUnknown - Throws:
java.sql.SQLException- if a database access error occurs- Since:
- 1.4
-
setIndex
private void setIndex(int index) throws java.sql.SQLException- Throws:
java.sql.SQLException
-
isSigned
public boolean isSigned(int index) throws java.sql.SQLExceptionRetrieves whether values for the designated parameter can be signed numbers.- Specified by:
isSignedin interfacejava.sql.ParameterMetaData- Parameters:
index- the first parameter is 1, the second is 2, ...- Returns:
trueif so;falseotherwise- Throws:
java.sql.SQLException- if a database access error occurs- Since:
- 1.4
-
getPrecision
public int getPrecision(int index) throws java.sql.SQLExceptionRetrieves the designated parameter's specified column size.The returned value represents the maximum column size for the given parameter. For numeric data, this is the maximum precision. For character data, this is the length in characters. For datetime datatypes, this is the length in characters of the String representation (assuming the maximum allowed precision of the fractional seconds component). For binary data, this is the length in bytes. For the ROWID datatype, this is the length in bytes. 0 is returned for data types where the column size is not applicable.
- Specified by:
getPrecisionin interfacejava.sql.ParameterMetaData- Parameters:
index- the first parameter is 1, the second is 2, ...- Returns:
- precision
- Throws:
java.sql.SQLException- if a database access error occurs
-
getScale
public int getScale(int index) throws java.sql.SQLExceptionRetrieves the designated parameter's number of digits to right of the decimal point. 0 is returned for data types where the scale is not applicable.- Specified by:
getScalein interfacejava.sql.ParameterMetaData- Parameters:
index- the first parameter is 1, the second is 2, ...- Returns:
- scale
- Throws:
java.sql.SQLException- if a database access error occurs
-
getParameterName
public java.lang.String getParameterName(int index) throws java.sql.SQLExceptionReturn the parameter name corresponding to index.- Parameters:
index- index- Returns:
- parameter name
- Throws:
java.sql.SQLException- if wrong index
-
getParameterType
public int getParameterType(int index) throws java.sql.SQLExceptionRetrieves the designated parameter's SQL type.- Specified by:
getParameterTypein interfacejava.sql.ParameterMetaData- Parameters:
index- the first parameter is 1, the second is 2, ...- Returns:
- SQL types from
java.sql.Types - Throws:
java.sql.SQLException- if a database access error occurs- Since:
- 1.4
- See Also:
Types
-
getParameterTypeName
public java.lang.String getParameterTypeName(int index) throws java.sql.SQLExceptionRetrieves the designated parameter's database-specific type name.- Specified by:
getParameterTypeNamein interfacejava.sql.ParameterMetaData- Parameters:
index- the first parameter is 1, the second is 2, ...- Returns:
- type the name used by the database. If the parameter type is a user-defined type, then a fully-qualified type name is returned.
- Throws:
java.sql.SQLException- if a database access error occurs- Since:
- 1.4
-
getParameterClassName
public java.lang.String getParameterClassName(int index) throws java.sql.SQLExceptionRetrieves the fully-qualified name of the Java class whose instances should be passed to the methodPreparedStatement.setObject.- Specified by:
getParameterClassNamein interfacejava.sql.ParameterMetaData- Parameters:
index- the first parameter is 1, the second is 2, ...- Returns:
- the fully-qualified name of the class in the Java programming language that would be
used by the method
PreparedStatement.setObjectto set the value in the specified parameter. This is the class name used for custom mapping. - Throws:
java.sql.SQLException- if a database access error occurs- Since:
- 1.4
-
getParameterMode
public int getParameterMode(int index) throws java.sql.SQLExceptionRetrieves the designated parameter's mode.- Specified by:
getParameterModein interfacejava.sql.ParameterMetaData- Parameters:
index- the first parameter is 1, the second is 2, ...- Returns:
- mode of the parameter; one of
ParameterMetaData.parameterModeIn,ParameterMetaData.parameterModeOut, orParameterMetaData.parameterModeInOutParameterMetaData.parameterModeUnknown. - Throws:
java.sql.SQLException- if a database access error occurs- Since:
- 1.4
-
unwrap
public <T> T unwrap(java.lang.Class<T> iface) throws java.sql.SQLExceptionReturns an object that implements the given interface to allow access to non-standard methods, or standard methods not exposed by the proxy.If the receiver implements the interface then the result is the receiver or a proxy for the receiver. If the receiver is a wrapper and the wrapped object implements the interface then the result is the wrapped object or a proxy for the wrapped object. Otherwise, return the result of calling
unwraprecursively on the wrapped object or a proxy for that result. If the receiver is not a wrapper and does not implement the interface, then anSQLExceptionis thrown.- Specified by:
unwrapin interfacejava.sql.Wrapper- Parameters:
iface- A Class defining an interface that the result must implement.- Returns:
- an object that implements the interface. Maybe a proxy for the actual implementing object.
- Throws:
java.sql.SQLException- If no object found that implements the interface- Since:
- 1.6
-
isWrapperFor
public boolean isWrapperFor(java.lang.Class<?> iface)
Returns true if this either implements the interface argument or is directly or indirectly a wrapper for an object that does. Returns false otherwise. If this implements the interface then return true, else if this is a wrapper then return the result of recursively callingisWrapperForon the wrapped object. If this does not implement the interface and is not a wrapper, return false. This method should be implemented as a low-cost operation compared tounwrapso that callers can use this method to avoid expensiveunwrapcalls that may fail. If this method returns true then callingunwrapwith the same argument should succeed.- Specified by:
isWrapperForin interfacejava.sql.Wrapper- Parameters:
iface- a Class defining an interface.- Returns:
- true if this implements the interface or directly or indirectly wraps an object that does.
- Since:
- 1.6
-
-