public class CallableParameterMetaData
extends java.lang.Object
implements java.sql.ParameterMetaData
Modifier and Type | Field and Description |
---|---|
private MariaDbConnection |
con |
private java.lang.String |
database |
private boolean |
isFunction |
private java.lang.String |
name |
private static java.util.regex.Pattern |
PARAMETER_PATTERN |
private java.util.List<CallParameter> |
params |
private static java.util.regex.Pattern |
RETURN_PATTERN |
private boolean |
valid |
Constructor and Description |
---|
CallableParameterMetaData(MariaDbConnection con,
java.lang.String database,
java.lang.String name,
boolean isFunction)
Retrieve Callable metaData.
|
Modifier and Type | Method and Description |
---|---|
java.lang.String |
getDatabase() |
java.lang.String |
getName(int param) |
(package private) CallParameter |
getParam(int index) |
java.lang.String |
getParameterClassName(int param) |
int |
getParameterCount() |
int |
getParameterMode(int param)
Get mode info.
|
int |
getParameterType(int param) |
java.lang.String |
getParameterTypeName(int param) |
int |
getPrecision(int param) |
int |
getScale(int param) |
int |
isNullable(int param) |
boolean |
isSigned(int param) |
boolean |
isWrapperFor(java.lang.Class<?> iface) |
(package private) int |
mapMariaDbTypeToJdbc(java.lang.String str) |
private void |
parseFunctionReturnParam(java.lang.String functionReturn) |
private void |
parseParamList(boolean isFunction,
java.lang.String paramList) |
private java.lang.String[] |
queryMetaInfos(boolean isFunction) |
void |
readMetadata()
Read procedure metadata from mysql.proc table(column param_list).
|
void |
readMetadataFromDbIfRequired()
Search metaData if not already loaded.
|
<T> T |
unwrap(java.lang.Class<T> iface) |
private static java.util.regex.Pattern PARAMETER_PATTERN
private static java.util.regex.Pattern RETURN_PATTERN
private java.util.List<CallParameter> params
private MariaDbConnection con
private java.lang.String database
private java.lang.String name
private boolean valid
private boolean isFunction
public CallableParameterMetaData(MariaDbConnection con, java.lang.String database, java.lang.String name, boolean isFunction)
con
- connectiondatabase
- database namename
- procedure/function nameisFunction
- is it a functionpublic void readMetadataFromDbIfRequired() throws java.sql.SQLException
java.sql.SQLException
- if error append during loading metaDataint mapMariaDbTypeToJdbc(java.lang.String str)
private java.lang.String[] queryMetaInfos(boolean isFunction) throws java.sql.SQLException
java.sql.SQLException
private void parseFunctionReturnParam(java.lang.String functionReturn) throws java.sql.SQLException
java.sql.SQLException
private void parseParamList(boolean isFunction, java.lang.String paramList) throws java.sql.SQLException
java.sql.SQLException
public void readMetadata() throws java.sql.SQLException
java.sql.SQLException
- if data doesn't correspond.public int getParameterCount() throws java.sql.SQLException
getParameterCount
in interface java.sql.ParameterMetaData
java.sql.SQLException
CallParameter getParam(int index) throws java.sql.SQLException
java.sql.SQLException
public int isNullable(int param) throws java.sql.SQLException
isNullable
in interface java.sql.ParameterMetaData
java.sql.SQLException
public boolean isSigned(int param) throws java.sql.SQLException
isSigned
in interface java.sql.ParameterMetaData
java.sql.SQLException
public int getPrecision(int param) throws java.sql.SQLException
getPrecision
in interface java.sql.ParameterMetaData
java.sql.SQLException
public int getScale(int param) throws java.sql.SQLException
getScale
in interface java.sql.ParameterMetaData
java.sql.SQLException
public int getParameterType(int param) throws java.sql.SQLException
getParameterType
in interface java.sql.ParameterMetaData
java.sql.SQLException
public java.lang.String getParameterTypeName(int param) throws java.sql.SQLException
getParameterTypeName
in interface java.sql.ParameterMetaData
java.sql.SQLException
public java.lang.String getParameterClassName(int param) throws java.sql.SQLException
getParameterClassName
in interface java.sql.ParameterMetaData
java.sql.SQLException
public int getParameterMode(int param) throws java.sql.SQLException
getParameterMode
in interface java.sql.ParameterMetaData
param
- parameter indexjava.sql.SQLException
- if index is wrongpublic java.lang.String getName(int param) throws java.sql.SQLException
java.sql.SQLException
public <T> T unwrap(java.lang.Class<T> iface) throws java.sql.SQLException
unwrap
in interface java.sql.Wrapper
java.sql.SQLException
public boolean isWrapperFor(java.lang.Class<?> iface) throws java.sql.SQLException
isWrapperFor
in interface java.sql.Wrapper
java.sql.SQLException
public java.lang.String getDatabase() throws java.sql.SQLException
java.sql.SQLException