本文整理汇总了Java中java.sql.DatabaseMetaData.getTableTypes方法的典型用法代码示例。如果您正苦于以下问题:Java DatabaseMetaData.getTableTypes方法的具体用法?Java DatabaseMetaData.getTableTypes怎么用?Java DatabaseMetaData.getTableTypes使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类java.sql.DatabaseMetaData
的用法示例。
在下文中一共展示了DatabaseMetaData.getTableTypes方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: testGetTableTypes
import java.sql.DatabaseMetaData; //导入方法依赖的package包/类
@Test public void testGetTableTypes() throws SQLException {
DatabaseMetaData metadata = getDatabaseMetadata();
try (ResultSet rs = metadata.getTableTypes()) {
ResultSetMetaData rsMeta = rs.getMetaData();
assertEquals(1, rsMeta.getColumnCount());
assertColumn(rsMeta, 1, "TABLE_TYPE", Types.VARCHAR, DatabaseMetaData.columnNoNulls);
}
}
示例2: 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))
{
}
}
}