public ResultSet getTables(String catalog,
String schemaPattern,
String tableNamePattern,
String[] types)
throws SQLExceptionRetrieves a description of the tables available in the given catalog. Only table descriptions matching the catalog, schema, table name and type criteria are returned. They are ordered by TABLE_TYPE, TABLE_SCHEM and TABLE_NAME. Parameters:
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
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
tableNamePattern - a table name pattern; must match the table name as it is stored in the database
types - a list of table types to include; null returns all types
String schemaPattern,
String tableNamePattern,
String[] types)
throws SQLExceptionRetrieves a description of the tables available in the given catalog. Only table descriptions matching the catalog, schema, table name and type criteria are returned. They are ordered by TABLE_TYPE, TABLE_SCHEM and TABLE_NAME. Parameters:
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
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
tableNamePattern - a table name pattern; must match the table name as it is stored in the database
types - a list of table types to include; null returns all types
解决方案 »
- 如果需要了解sql server如何存储int型/datetime型的,那么请看
- SQL语句(排序)
- 关于自增量的问题,删除表内一条记录,怎么使后面的自增量补上去
- 一个存储过程实现的效果如何用一句sql语句实现
- 插入数据的存储过程错误!!!,高的莫名其妙
- varchar sql脚本里面如何取一个特殊符号的asc码?
- 关于SQL server2000数据库受损的问题,如何修复????
- SQL 服务 不能启动
- 高分求一sql server 2000企业版cd-key
- 请各位指点一下,如何通过编写存储过程往一个已存在的视图里插入一新列。
- 唉呀,困了我好久,始终不得其解,哪位好人帮一下,不是我太懒,可能是我太笨。
- 请教一个关于varbinary数据的问题,有点长...见谅...
{
public static void main(String[] args) throws Exception
{
Class.forName("com.microsoft.jdbc.sqlserver.SQLServerDriver");
java.sql.DatabaseMetaData databaseMetaData = java.sql.DriverManager.getConnection("jdbc:microsoft:sqlserver://yuer-mobile\\psqlkd;database=Northwind;User=sa;Password=").getMetaData();
java.sql.ResultSet resultSet = databaseMetaData.getTables(null,null,null,null);
while (resultSet.next())
{
System.out.println( resultSet.getString("TABLE_NAME"));
}
}
}