com.ibm.as400.access
Class AS400JDBCParameterMetaData
- java.lang.Object
-
- com.ibm.as400.access.AS400JDBCParameterMetaData
-
- All Implemented Interfaces:
- java.sql.ParameterMetaData, java.sql.Wrapper
public class AS400JDBCParameterMetaData extends java.lang.Object implements java.sql.ParameterMetaData
The AS400JDBCParameterMetaData class can be used to retrieve information about the parameters of a PreparedStatement. Use PreparedStatement.getParameterMetaData() to create new ParameterMetaData objects.
-
-
Method Summary
Methods Modifier and Type Method and Description java.lang.String
getParameterClassName(int parameterIndex)
Returns the fully-qualified name of the Java class of the specified parameter.int
getParameterCount()
Returns the number of parameters in this ParameterMetaData object.int
getParameterMode(int parameterIndex)
Returns the mode of the specified parameter or if that information is unknown.int
getParameterType(int parameterIndex)
Returns the SQL type of the specified parameter.java.lang.String
getParameterTypeName(int parameterIndex)
Returns the database-specific type name of the specified parameter.int
getPrecision(int parameterIndex)
Returns the number of decimal digits of the specified parameter.int
getScale(int parameterIndex)
Returns the number of digits to the right of the decimal point of the specified parameter.protected java.lang.String[]
getValidWrappedList()
int
isNullable(int parameterIndex)
Returns if the specified parameter can be null or that information is unknown.boolean
isSigned(int parameterIndex)
Returns if values can be signed numbers for the specified parameter.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.<T> T
unwrap(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.
-
-
-
Method Detail
-
getParameterClassName
public java.lang.String getParameterClassName(int parameterIndex) throws java.sql.SQLException
Returns the fully-qualified name of the Java class of the specified parameter.- Specified by:
getParameterClassName
in interfacejava.sql.ParameterMetaData
- Parameters:
parameterIndex
- The parameter index (1-based).- Returns:
- The fully-qualified name of the Java class.
- Throws:
java.sql.SQLException
- If the prepared statement is not open.
-
getParameterCount
public int getParameterCount() throws java.sql.SQLException
Returns the number of parameters in this ParameterMetaData object.- Specified by:
getParameterCount
in interfacejava.sql.ParameterMetaData
- Returns:
- The number of parameters in the ParameterMetaData object.
- Throws:
java.sql.SQLException
- If the prepared statement is not open.
-
getParameterMode
public int getParameterMode(int parameterIndex) throws java.sql.SQLException
Returns the mode of the specified parameter or if that information is unknown.- Specified by:
getParameterMode
in interfacejava.sql.ParameterMetaData
- Parameters:
parameterIndex
- The parameter index (1-based).- Returns:
- The mode of the parameter. Valid values are ParameterMetaData.parameterModeIn, ParameterMetaData.parameterModeOut, ParameterMetaData.parameterModeInOut, and ParameterMetaData.parameterModeUnknown.
- Throws:
java.sql.SQLException
- If the prepared statement is not open.
-
getParameterType
public int getParameterType(int parameterIndex) throws java.sql.SQLException
Returns the SQL type of the specified parameter.- Specified by:
getParameterType
in interfacejava.sql.ParameterMetaData
- Parameters:
parameterIndex
- The parameter index (1-based).- Returns:
- The SQL type of the parameter.
- Throws:
java.sql.SQLException
- If the prepared statement is not open.
-
getParameterTypeName
public java.lang.String getParameterTypeName(int parameterIndex) throws java.sql.SQLException
Returns the database-specific type name of the specified parameter.- Specified by:
getParameterTypeName
in interfacejava.sql.ParameterMetaData
- Parameters:
parameterIndex
- The parameter index (1-based).- Returns:
- The type name of the parameter.
- Throws:
java.sql.SQLException
- If the prepared statement is not open.
-
getPrecision
public int getPrecision(int parameterIndex) throws java.sql.SQLException
Returns the number of decimal digits of the specified parameter.- Specified by:
getPrecision
in interfacejava.sql.ParameterMetaData
- Parameters:
parameterIndex
- The parameter index (1-based).- Returns:
- The precision of the parameter.
- Throws:
java.sql.SQLException
- If the prepared statement is not open.
-
getScale
public int getScale(int parameterIndex) throws java.sql.SQLException
Returns the number of digits to the right of the decimal point of the specified parameter.- Specified by:
getScale
in interfacejava.sql.ParameterMetaData
- Parameters:
parameterIndex
- The parameter index (1-based).- Returns:
- The scale of the parameter.
- Throws:
java.sql.SQLException
- If the prepared statement is not open.
-
isNullable
public int isNullable(int parameterIndex) throws java.sql.SQLException
Returns if the specified parameter can be null or that information is unknown.- Specified by:
isNullable
in interfacejava.sql.ParameterMetaData
- Parameters:
parameterIndex
- The parameter index (1-based).- Returns:
- Returns if the parameter can be null. The valid values are ParameterMetaData.parameterNoNulls, ParameterMetaData.parameterNullable, and ParameterMetaData.parameterNullableUnknown.
- Throws:
java.sql.SQLException
- If the prepared statement is not open.
-
isSigned
public boolean isSigned(int parameterIndex) throws java.sql.SQLException
Returns if values can be signed numbers for the specified parameter.- Specified by:
isSigned
in interfacejava.sql.ParameterMetaData
- Parameters:
parameterIndex
- The parameter index (1-based).- Returns:
- Returns true if values for the specified parameter can be signed numbers, false otherwise.
- Throws:
java.sql.SQLException
- If the prepared statement is not open.
-
getValidWrappedList
protected java.lang.String[] getValidWrappedList()
-
isWrapperFor
public boolean isWrapperFor(java.lang.Class<?> iface) throws java.sql.SQLException
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 callingisWrapperFor
on 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 tounwrap
so that callers can use this method to avoid expensiveunwrap
calls that may fail. If this method returns true then callingunwrap
with the same argument should succeed.- Specified by:
isWrapperFor
in 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.
- Throws:
java.sql.SQLException
- if an error occurs while determining whether this is a wrapper for an object with the given interface.
-
unwrap
public <T> T unwrap(java.lang.Class<T> iface) throws java.sql.SQLException
Returns 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 the result of callingunwrap
recursively on the wrapped object or a proxy for that result. If the receiver is not a wrapper and does not implement the interface, then anSQLException
is thrown.- Specified by:
unwrap
in interfacejava.sql.Wrapper
- Parameters:
iface
- A Class defining an interface that the result must implement.- Returns:
- an object that implements the interface. May be a proxy for the actual implementing object.
- Throws:
java.sql.SQLException
- If no object found that implements the interface
-
-