提交 6cc6df0c authored 作者: Thomas Mueller's avatar Thomas Mueller

Shell tool: improved PostgreSQL compatibility.

上级 311a7d5e
...@@ -216,11 +216,11 @@ public class Shell extends Tool { ...@@ -216,11 +216,11 @@ public class Shell extends Tool {
PreparedStatement prep = null; PreparedStatement prep = null;
ResultSet rs = null; ResultSet rs = null;
try { try {
String sql = "SELECT CAST(COLUMN_NAME AS VARCHAR(32)) \"Column Name\", " + String sql = "SELECT CAST(COLUMN_NAME AS VARCHAR(32)) AS \"Column Name\", " +
"CAST(TYPE_NAME AS VARCHAR(14)) \"Type\", " + "CAST(TYPE_NAME AS VARCHAR(14)) AS \"Type\", " +
"NUMERIC_PRECISION \"Precision\", " + "NUMERIC_PRECISION AS \"Precision\", " +
"CAST(IS_NULLABLE AS VARCHAR(8)) \"Nullable\", " + "CAST(IS_NULLABLE AS VARCHAR(8)) AS \"Nullable\", " +
"CAST(COLUMN_DEFAULT AS VARCHAR(20)) \"Default\" " + "CAST(COLUMN_DEFAULT AS VARCHAR(20)) AS \"Default\" " +
"FROM INFORMATION_SCHEMA.COLUMNS " + "FROM INFORMATION_SCHEMA.COLUMNS " +
"WHERE UPPER(TABLE_NAME)=?"; "WHERE UPPER(TABLE_NAME)=?";
if (schemaName != null) { if (schemaName != null) {
...@@ -246,7 +246,7 @@ public class Shell extends Tool { ...@@ -246,7 +246,7 @@ public class Shell extends Tool {
ResultSet rs = null; ResultSet rs = null;
try { try {
rs = stat.executeQuery( rs = stat.executeQuery(
"SELECT CAST(TABLE_SCHEMA AS VARCHAR(32)) \"Schema\", TABLE_NAME \"Table Name\" " + "SELECT CAST(TABLE_SCHEMA AS VARCHAR(32)) AS \"Schema\", TABLE_NAME AS \"Table Name\" " +
"FROM INFORMATION_SCHEMA.TABLES ORDER BY TABLE_SCHEMA, TABLE_NAME"); "FROM INFORMATION_SCHEMA.TABLES ORDER BY TABLE_SCHEMA, TABLE_NAME");
printResult(rs, false); printResult(rs, false);
} catch (SQLException e) { } catch (SQLException e) {
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论