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.
*
* @param interfaces a Class defining an interface.
* @return 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.
* @since 1.6
*/
public boolean isWrapperFor(Class> iface) throws SQLException {
// This works for classes that aren't actually wrapping
// anything
return iface.isInstance(this);
}
/**
* Returns an object that implements the given interface to allow access to non-standard methods,
* or standard methods not exposed by the proxy.
* The result may be either the object found to implement the interface or a proxy for that object.
* If the receiver implements the interface then that is the object. If the receiver is a wrapper
* and the wrapped object implements the interface then that is the object. Otherwise the object is
* the result of calling unwrap
recursively on the wrapped object. If the receiver is not a
* wrapper and does not implement the interface, then an SQLException
is thrown.
*
* @param iface A Class defining an interface that the result must implement.
* @return 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
* @since 1.6
*/
public *
* The ResultSet
is sorted by the NAME column
*
* @return A ResultSet
object; each row is a supported client info
* property
*
* @exception SQLException if a database access error occurs *
* @since 1.6 */ public ResultSet getClientInfoProperties() throws SQLException { // We don't have any built-ins, we actually support whatever // the client wants to provide, however we don't have a way // to express this with the interface given Field[] fields = new Field[4]; fields[0] = new Field("", "NAME", Types.VARCHAR, 255); fields[1] = new Field("", "MAX_LEN", Types.INTEGER, 10); fields[2] = new Field("", "DEFAULT_VALUE", Types.VARCHAR, 255); fields[3] = new Field("", "DESCRIPTION", Types.VARCHAR, 255); ArrayList tuples = new ArrayList(); return buildResultSet(fields, tuples, this.conn); } public boolean autoCommitFailureClosesAllResultSets() throws SQLException { return false; } /** * Retrieves a description of the system and user functions available * in the given catalog. *
* Only system and user function descriptions matching the schema and
* function name criteria are returned. They are ordered by
* FUNCTION_CAT
, FUNCTION_SCHEM
,
* FUNCTION_NAME
and
* SPECIFIC_ NAME
.
*
*
Each function description has the the following columns: *
null
)
* null
)
* FUNCTION_NAME
* for example with overload functions
*
* A user may not have permission to execute any of the functions that are
* returned by getFunctions
*
* @param catalog a catalog name; must match the catalog name as it
* is stored in the database; "" retrieves those without a catalog;
* null
means that the catalog name should not be used to narrow
* the search
* @param schemaPattern a schema name pattern; must match the schema name
* as it is stored in the database; "" retrieves those without a schema;
* null
means that the schema name should not be used to narrow
* the search
* @param functionNamePattern a function name pattern; must match the
* function name as it is stored in the database
* @return ResultSet
- each row is a function description
* @exception SQLException if a database access error occurs
* @see #getSearchStringEscape
* @since 1.6
*/
public java.sql.ResultSet getFunctions(String catalog, String schemaPattern,
String functionNamePattern) throws SQLException {
Field[] fields = new Field[6];
fields[0] = new Field("", "FUNCTION_CAT", Types.CHAR, 255);
fields[1] = new Field("", "FUNCTION_SCHEM", Types.CHAR, 255);
fields[2] = new Field("", "FUNCTION_NAME", Types.CHAR, 255);
fields[3] = new Field("", "REMARKS", Types.CHAR, 255);
fields[4] = new Field("", "FUNCTION_TYPE", Types.SMALLINT, 6);
fields[5] = new Field("", "SPECIFIC_NAME", Types.CHAR, 255);
return getProceduresAndOrFunctions(
fields,
catalog,
schemaPattern,
functionNamePattern,
false,
true);
}
protected int getJDBC4FunctionNoTableConstant() {
return functionNoTable;
}
}