com.foundationdb.sql.jdbc.jdbc4.AbstractJdbc4ResultSetMetaData Maven / Gradle / Ivy
/*-------------------------------------------------------------------------
*
* Copyright (c) 2004-2011, PostgreSQL Global Development Group
*
*
*-------------------------------------------------------------------------
*/
package com.foundationdb.sql.jdbc.jdbc4;
import com.foundationdb.sql.jdbc.core.*;
import java.sql.SQLException;
abstract class AbstractJdbc4ResultSetMetaData extends com.foundationdb.sql.jdbc.jdbc2.AbstractJdbc2ResultSetMetaData
{
public AbstractJdbc4ResultSetMetaData(BaseConnection connection, Field[] fields)
{
super(connection, fields);
}
public boolean isWrapperFor(Class> iface) throws SQLException
{
return iface.isAssignableFrom(getClass());
}
public T unwrap(Class iface) throws SQLException
{
if (iface.isAssignableFrom(getClass()))
{
return (T) this;
}
throw new SQLException("Cannot unwrap to " + iface.getName());
}
}