提交 83579e6f authored 作者: Thomas Mueller's avatar Thomas Mueller

H2 Console: opening a MS SQL Server database is now faster. Also, listing the…

H2 Console: opening a MS SQL Server database is now faster. Also, listing the database meta data sometimes resulted in an exception.
上级 d99167aa
......@@ -72,6 +72,11 @@ public class DbContents {
*/
boolean isSQLite;
/**
* True if this is a MS SQL Server database.
*/
boolean isMSSQLServer;
/**
* True if the unquoted names are stored as upper case.
* False for MySQL and PostgreSQL.
......@@ -101,7 +106,7 @@ public class DbContents {
*
* @param meta the database meta data
*/
void readContents(DatabaseMetaData meta) throws SQLException {
synchronized void readContents(DatabaseMetaData meta) throws SQLException {
String prod = StringUtils.toLowerEnglish(meta.getDatabaseProductName());
isSQLite = prod.indexOf("sqlite") >= 0;
String url = meta.getURL();
......@@ -124,6 +129,7 @@ public class DbContents {
isMySQL = url.startsWith("jdbc:mysql:");
isDerby = url.startsWith("jdbc:derby:");
isFirebird = url.startsWith("jdbc:firebirdsql:");
isMSSQLServer = url.startsWith("jdbc:sqlserver:");
}
storedUpperCaseIdentifiers = meta.storesUpperCaseIdentifiers();
String defaultSchemaName = getDefaultSchemaName(meta);
......@@ -178,6 +184,16 @@ public class DbContents {
break;
}
}
} else if (isMSSQLServer) {
for (String ignore : new String[] {
"sys", "db_accessadmin", "db_backupoperator", "db_datareader", "db_datawriter", "db_ddladmin",
"db_denydatareader", "db_denydatawriter", "db_owner", "db_securityadmin"
}) {
if (ignore.equals(schema)) {
schema = null;
break;
}
}
}
if (schema == null) {
continue;
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论