|
@@ -138,7 +138,7 @@ public class DataBase {
|
|
|
} catch (SQLException e) {
|
|
|
connection.rollback();
|
|
|
throw e;
|
|
|
- }finally {
|
|
|
+ } finally {
|
|
|
connection.commit();
|
|
|
}
|
|
|
}
|
|
@@ -381,11 +381,11 @@ public class DataBase {
|
|
|
Connection conn = getDataSourcePool(connection).getConnection();
|
|
|
metaData = conn.getMetaData();
|
|
|
|
|
|
- if(connection.contains("jdbc:kingbase") || connection.contains("jdbc:postgres")) {
|
|
|
+ if (connection.contains("jdbc:kingbase") || connection.contains("jdbc:postgres")) {
|
|
|
resultSet = metaData.getColumns(null, "public", tableName, null);
|
|
|
- }else if(connection.contains("jdbc:oracle") ) {
|
|
|
+ } else if (connection.contains("jdbc:oracle")) {
|
|
|
resultSet = metaData.getColumns(null, conn.getMetaData().getUserName(), tableName, null);
|
|
|
- }else{
|
|
|
+ } else {
|
|
|
resultSet = metaData.getColumns(conn.getCatalog(), null, tableName, null);
|
|
|
}
|
|
|
|
|
@@ -431,11 +431,11 @@ public class DataBase {
|
|
|
ArrayList<String> result = new ArrayList<>();
|
|
|
try (Connection conn = getDataSourcePool(connection).getConnection()) {
|
|
|
metaData = conn.getMetaData();
|
|
|
- if(connection.contains("jdbc:kingbase") || connection.contains("jdbc:postgres")) {
|
|
|
+ if (connection.contains("jdbc:kingbase") || connection.contains("jdbc:postgres")) {
|
|
|
resultSet = metaData.getTables(null, "public", null, new String[]{"TABLE"});
|
|
|
- }else if(connection.contains("jdbc:oracle") ) {
|
|
|
+ } else if (connection.contains("jdbc:oracle")) {
|
|
|
resultSet = metaData.getTables(null, conn.getMetaData().getUserName(), "%", new String[]{"TABLE"});
|
|
|
- }else{
|
|
|
+ } else {
|
|
|
resultSet = metaData.getTables(conn.getCatalog(), null, null, new String[]{"TABLE"});
|
|
|
}
|
|
|
while (resultSet.next()) {
|