执行SQL语句就可以了: SQL SERVER:SELECT NAME FROM sysobjects WHERE (xtype = 'U') AND (OBJECTPROPERTY(id, 'IsMSShipped') = 0) ORDER BY NAME ORACLE:select distinct table_name AS NAME from user_tables MYSQL:show tables SYBASE:SELECT name FROM sysobjects WHERE type = 'U' ORDER BY name
Statement stmt = ...;
ResultSet rs = stmt.executeQuery("show tables");
while(rs.next()) {
String tableName = rs.getString(1);
...
}
SQL SERVER:SELECT NAME FROM sysobjects WHERE (xtype = 'U') AND (OBJECTPROPERTY(id, 'IsMSShipped') = 0) ORDER BY NAME
ORACLE:select distinct table_name AS NAME from user_tables
MYSQL:show tables
SYBASE:SELECT name FROM sysobjects WHERE type = 'U' ORDER BY name
SELECT name
FROM sysobjects
WHERE (xtype = 'U')