1 21 22 package org.apache.derby.client.net; 23 24 import java.sql.ResultSet ; 25 import java.sql.RowIdLifetime ; 26 import java.sql.SQLException ; 27 import org.apache.derby.client.am.ClientMessageId; 28 import org.apache.derby.client.am.SqlException; 29 import org.apache.derby.client.am.SQLExceptionFactory; 30 import org.apache.derby.shared.common.reference.SQLState; 31 32 public class NetDatabaseMetaData40 extends org.apache.derby.client.net.NetDatabaseMetaData { 33 34 35 public NetDatabaseMetaData40(NetAgent netAgent, NetConnection netConnection) { 36 super(netAgent,netConnection); 37 } 38 39 44 public int getJDBCMajorVersion() throws SQLException { 45 checkForClosedConnection(); 46 return 4; 47 } 48 49 54 public int getJDBCMinorVersion() throws SQLException { 55 checkForClosedConnection(); 56 return 0; 57 } 58 59 67 public RowIdLifetime getRowIdLifetime() throws SQLException { 68 checkForClosedConnection(); 69 return RowIdLifetime.ROWID_UNSUPPORTED; 70 } 71 72 83 public boolean isWrapperFor(Class <?> interfaces) throws SQLException { 84 return interfaces.isInstance(this); 85 } 86 87 95 public <T> T unwrap(java.lang.Class <T> interfaces) 96 throws SQLException { 97 try { 98 return interfaces.cast(this); 99 } catch (ClassCastException cce) { 100 throw new SqlException(null, 101 new ClientMessageId(SQLState.UNABLE_TO_UNWRAP), 102 interfaces).getSQLException(); 103 } 104 } 105 } 106 | Popular Tags |