本文整理汇总了Java中java.sql.DatabaseMetaData.getSuperTypes方法的典型用法代码示例。如果您正苦于以下问题:Java DatabaseMetaData.getSuperTypes方法的具体用法?Java DatabaseMetaData.getSuperTypes怎么用?Java DatabaseMetaData.getSuperTypes使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类java.sql.DatabaseMetaData
的用法示例。
在下文中一共展示了DatabaseMetaData.getSuperTypes方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: testBug44508
import java.sql.DatabaseMetaData; //导入方法依赖的package包/类
public void testBug44508() throws Exception {
DatabaseMetaData dbmd = this.conn.getMetaData();
this.rs = dbmd.getSuperTypes("", "", "");
ResultSetMetaData rsmd = this.rs.getMetaData();
assertEquals("TYPE_CAT", rsmd.getColumnName(1)); // Gives TABLE_CAT
assertEquals("TYPE_SCHEM", rsmd.getColumnName(2)); // Gives TABLE_SCHEM
}
示例2: testGetSuperTypes
import java.sql.DatabaseMetaData; //导入方法依赖的package包/类
@Test public void testGetSuperTypes() throws SQLException {
DatabaseMetaData metadata = getDatabaseMetadata();
try (ResultSet rs = metadata.getSuperTypes(null, null, null)) {
ResultSetMetaData rsMeta = rs.getMetaData();
assertEquals(6, rsMeta.getColumnCount());
assertColumn(rsMeta, 1, "TYPE_CAT", Types.VARCHAR, DatabaseMetaData.columnNullable);
assertColumn(rsMeta, 2, "TYPE_SCHEM", Types.VARCHAR, DatabaseMetaData.columnNullable);
assertColumn(rsMeta, 3, "TYPE_NAME", Types.VARCHAR, DatabaseMetaData.columnNoNulls);
assertColumn(rsMeta, 4, "SUPERTYPE_CAT", Types.VARCHAR, DatabaseMetaData.columnNullable);
assertColumn(rsMeta, 5, "SUPERTYPE_SCHEM", Types.VARCHAR, DatabaseMetaData.columnNullable);
assertColumn(rsMeta, 6, "SUPERTYPE_NAME", Types.VARCHAR, DatabaseMetaData.columnNoNulls);
}
}
示例3: runOtherMetaDataTests
import java.sql.DatabaseMetaData; //导入方法依赖的package包/类
private void runOtherMetaDataTests() throws SQLException
{
DatabaseMetaData metadata = connection.getMetaData();
try (ResultSet rs = metadata.getCatalogs())
{
}
try (ResultSet rs = metadata.getAttributes("", "", null, null))
{
}
try (ResultSet rs = metadata.getClientInfoProperties())
{
}
try (ResultSet rs = metadata.getFunctionColumns("", "", null, null))
{
}
try (ResultSet rs = metadata.getFunctions("", "", null))
{
}
try (ResultSet rs = metadata.getProcedureColumns("", "", null, null))
{
}
try (ResultSet rs = metadata.getProcedures("", "", null))
{
}
try (ResultSet rs = metadata.getSchemas())
{
}
try (ResultSet rs = metadata.getSchemas("", null))
{
}
try (ResultSet rs = metadata.getSuperTypes("", "", null))
{
}
try (ResultSet rs = metadata.getTableTypes())
{
}
try (ResultSet rs = metadata.getTypeInfo())
{
}
try (ResultSet rs = metadata.getUDTs(null, null, null, null))
{
}
for (String table : TABLES)
{
try (ResultSet rs = metadata.getExportedKeys("", "", table))
{
}
try (ResultSet rs = metadata.getImportedKeys("", "", table))
{
}
try (ResultSet rs = metadata.getBestRowIdentifier("", "", table, DatabaseMetaData.bestRowTransaction,
false))
{
}
try (ResultSet rs = metadata.getColumnPrivileges("", "", table, null))
{
}
try (ResultSet rs = metadata.getPrimaryKeys("", "", table))
{
}
try (ResultSet rs = metadata.getPseudoColumns("", "", table, null))
{
}
try (ResultSet rs = metadata.getSuperTables("", "", table))
{
}
try (ResultSet rs = metadata.getTablePrivileges("", "", table))
{
}
try (ResultSet rs = metadata.getVersionColumns("", "", table))
{
}
}
}