From 0a7eaae49cad6e437f16db4e88c9a55b430891c9 Mon Sep 17 00:00:00 2001 From: Claus Nagel Date: Thu, 6 Feb 2025 12:14:21 +0100 Subject: [PATCH] minor change --- .../org/citydb/database/adapter/DatabaseAdapter.java | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/citydb-database/src/main/java/org/citydb/database/adapter/DatabaseAdapter.java b/citydb-database/src/main/java/org/citydb/database/adapter/DatabaseAdapter.java index 25a5308e..b5eb537c 100644 --- a/citydb-database/src/main/java/org/citydb/database/adapter/DatabaseAdapter.java +++ b/citydb-database/src/main/java/org/citydb/database/adapter/DatabaseAdapter.java @@ -99,7 +99,7 @@ public final DatabaseMetadata getDatabaseMetadata() { return databaseMetadata; } - private DatabaseVersion getCityDBVersion(Connection connection) throws SQLException { + private DatabaseVersion getCityDBVersion(Connection connection) throws DatabaseException { try (Statement stmt = connection.createStatement(); ResultSet rs = stmt.executeQuery(schemaAdapter.getCityDBVersion())) { if (rs.next()) { @@ -108,12 +108,14 @@ private DatabaseVersion getCityDBVersion(Connection connection) throws SQLExcept rs.getInt("minor_revision"), rs.getString("version")); } + } catch (SQLException e) { + throw new DatabaseException("Failed to retrieve the version of the 3DCityDB.", e); } - throw new SQLException("Failed to retrieve the version of the 3DCityDB."); + throw new DatabaseException("Failed to retrieve the version of the 3DCityDB."); } - private SpatialReference getDatabaseSrs(Connection connection) throws SQLException { + private SpatialReference getDatabaseSrs(Connection connection) throws DatabaseException { try (Statement stmt = connection.createStatement(); ResultSet rs = stmt.executeQuery(schemaAdapter.getDatabaseSrs())) { if (rs.next()) { @@ -123,8 +125,10 @@ private SpatialReference getDatabaseSrs(Connection connection) throws SQLExcepti rs.getString("srs_name"), rs.getString("wktext")); } + } catch (SQLException e) { + throw new DatabaseException("Failed to retrieve the spatial reference system of the 3DCityDB.", e); } - throw new SQLException("Failed to retrieve the spatial reference system of the 3DCityDB."); + throw new DatabaseException("Failed to retrieve the spatial reference system of the 3DCityDB."); } }