public class MariaDbResultSetMetaData
extends java.lang.Object
implements java.sql.ResultSetMetaData
Modifier and Type | Field and Description |
---|---|
private ColumnInformation[] |
fieldPackets |
private Options |
options |
private boolean |
returnTableAlias |
Constructor and Description |
---|
MariaDbResultSetMetaData(ColumnInformation[] fieldPackets,
Options options,
boolean returnTableAlias)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
java.lang.String |
getCatalogName(int column)
Get the designated column's table's schema.
|
java.lang.String |
getColumnClassName(int column)
Returns the fully-qualified name of the Java class whose instances are manufactured if the
method
ResultSet.getObject is called to retrieve a value from the column. |
int |
getColumnCount()
Returns the number of columns in this
ResultSet object. |
int |
getColumnDisplaySize(int column)
Indicates the designated column's normal maximum width in characters.
|
private ColumnInformation |
getColumnInformation(int column) |
java.lang.String |
getColumnLabel(int column)
Gets the designated column's suggested title for use in printouts and displays.
|
java.lang.String |
getColumnName(int column)
Get the designated column's name.
|
int |
getColumnType(int column)
Retrieves the designated column's SQL type.
|
java.lang.String |
getColumnTypeName(int column)
Retrieves the designated column's database-specific type name.
|
int |
getPrecision(int column)
Get the designated column's specified column size.
|
int |
getScale(int column)
Gets the designated column's number of digits to right of the decimal point.
|
java.lang.String |
getSchemaName(int column) |
java.lang.String |
getTableName(int column)
Gets the designated column's table name.
|
boolean |
isAutoIncrement(int column)
Indicates whether the designated column is automatically numbered.
|
boolean |
isCaseSensitive(int column)
Indicates whether a column's case matters.
|
boolean |
isCurrency(int column)
Indicates whether the designated column is a cash value.
|
boolean |
isDefinitelyWritable(int column)
Indicates whether a write on the designated column will definitely succeed.
|
int |
isNullable(int column)
Indicates the nullability of values in the designated column.
|
boolean |
isReadOnly(int column)
Indicates whether the designated column is definitely not writable.
|
boolean |
isSearchable(int column)
Indicates whether the designated column can be used in a where clause.
|
boolean |
isSigned(int column)
Indicates whether values in the designated column are signed numbers.
|
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.
|
boolean |
isWritable(int column)
Indicates whether it is possible for a write on the designated column to succeed.
|
<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.
|
private final ColumnInformation[] fieldPackets
private final Options options
private final boolean returnTableAlias
public MariaDbResultSetMetaData(ColumnInformation[] fieldPackets, Options options, boolean returnTableAlias)
fieldPackets
- column informationsoptions
- connection optionsreturnTableAlias
- must return table alias or real table namepublic int getColumnCount()
ResultSet
object.getColumnCount
in interface java.sql.ResultSetMetaData
public boolean isAutoIncrement(int column) throws java.sql.SQLException
isAutoIncrement
in interface java.sql.ResultSetMetaData
column
- the first column is 1, the second is 2, ...true
if so; false
otherwisejava.sql.SQLException
- if a database access error occurspublic boolean isCaseSensitive(int column) throws java.sql.SQLException
isCaseSensitive
in interface java.sql.ResultSetMetaData
column
- the first column is 1, the second is 2, ...true
if so; false
otherwisejava.sql.SQLException
- if a database access error occurspublic boolean isSearchable(int column)
isSearchable
in interface java.sql.ResultSetMetaData
column
- the first column is 1, the second is 2, ...true
if so; false
otherwisepublic boolean isCurrency(int column)
isCurrency
in interface java.sql.ResultSetMetaData
column
- the first column is 1, the second is 2, ...true
if so; false
otherwisepublic int isNullable(int column) throws java.sql.SQLException
isNullable
in interface java.sql.ResultSetMetaData
column
- the first column is 1, the second is 2, ...columnNoNulls
,
columnNullable
or columnNullableUnknown
java.sql.SQLException
- if a database access error occurspublic boolean isSigned(int column) throws java.sql.SQLException
isSigned
in interface java.sql.ResultSetMetaData
column
- the first column is 1, the second is 2, ...true
if so; false
otherwisejava.sql.SQLException
- if a database access error occurspublic int getColumnDisplaySize(int column) throws java.sql.SQLException
getColumnDisplaySize
in interface java.sql.ResultSetMetaData
column
- the first column is 1, the second is 2, ...java.sql.SQLException
- if a database access error occurspublic java.lang.String getColumnLabel(int column) throws java.sql.SQLException
AS
clause. If a SQL AS
is not
specified, the value returned from
getColumnLabel
will be the same as the value returned by the
getColumnName
method.getColumnLabel
in interface java.sql.ResultSetMetaData
column
- the first column is 1, the second is 2, ...java.sql.SQLException
- if a database access error occurspublic java.lang.String getColumnName(int column) throws java.sql.SQLException
getColumnName
in interface java.sql.ResultSetMetaData
column
- the first column is 1, the second is 2, ...java.sql.SQLException
- if a database access error occurspublic java.lang.String getCatalogName(int column) throws java.sql.SQLException
getCatalogName
in interface java.sql.ResultSetMetaData
column
- the first column is 1, the second is 2, ...java.sql.SQLException
- if a database access error occurspublic int getPrecision(int column) throws java.sql.SQLException
getPrecision
in interface java.sql.ResultSetMetaData
column
- the first column is 1, the second is 2, ...java.sql.SQLException
- if a database access error occurspublic int getScale(int column) throws java.sql.SQLException
getScale
in interface java.sql.ResultSetMetaData
column
- the first column is 1, the second is 2, ...java.sql.SQLException
- if a database access error occurspublic java.lang.String getTableName(int column) throws java.sql.SQLException
getTableName
in interface java.sql.ResultSetMetaData
column
- the first column is 1, the second is 2, ...java.sql.SQLException
- if a database access error occurspublic java.lang.String getSchemaName(int column)
getSchemaName
in interface java.sql.ResultSetMetaData
public int getColumnType(int column) throws java.sql.SQLException
getColumnType
in interface java.sql.ResultSetMetaData
column
- the first column is 1, the second is 2, ...java.sql.SQLException
- if a database access error occursTypes
public java.lang.String getColumnTypeName(int column) throws java.sql.SQLException
getColumnTypeName
in interface java.sql.ResultSetMetaData
column
- the first column is 1, the second is 2, ...java.sql.SQLException
- if a database access error occurspublic boolean isReadOnly(int column)
isReadOnly
in interface java.sql.ResultSetMetaData
column
- the first column is 1, the second is 2, ...true
if so; false
otherwisepublic boolean isWritable(int column)
isWritable
in interface java.sql.ResultSetMetaData
column
- the first column is 1, the second is 2, ...true
if so; false
otherwisepublic boolean isDefinitelyWritable(int column)
isDefinitelyWritable
in interface java.sql.ResultSetMetaData
column
- the first column is 1, the second is 2, ...true
if so; false
otherwisepublic java.lang.String getColumnClassName(int column) throws java.sql.SQLException
ResultSet.getObject
is called to retrieve a value from the column.
ResultSet.getObject
may return a subclass of the class returned by this method.getColumnClassName
in interface java.sql.ResultSetMetaData
column
- the first column is 1, the second is 2, ...ResultSet.getObject
to retrieve the value in the specified
column. This is the class name used for custom mapping.java.sql.SQLException
- if a database access error occursprivate ColumnInformation getColumnInformation(int column) throws java.sql.SQLException
java.sql.SQLException
public <T> T unwrap(java.lang.Class<T> iface) throws java.sql.SQLException
unwrap
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 an
SQLException
is thrown.unwrap
in interface java.sql.Wrapper
iface
- A Class defining an interface that the result must implement.java.sql.SQLException
- If no object found that implements the interfacepublic boolean isWrapperFor(java.lang.Class<?> iface) throws java.sql.SQLException
isWrapperFor
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 to unwrap
so that callers can use this method to avoid expensive
unwrap
calls that may fail. If this method returns true then calling
unwrap
with the same argument should succeed.isWrapperFor
in interface java.sql.Wrapper
iface
- a Class defining an interface.java.sql.SQLException
- if an error occurs while determining whether this is a wrapper for an
object with the given interface.