set exit(1) on jdbc error

This commit is contained in:
afischerdev 2023-05-22 11:27:17 +02:00
parent 511ac2752a
commit 3602e4202c

View file

@ -40,6 +40,9 @@ public class OsmCutter extends MapCreatorBase {
Connection conn = null; Connection conn = null;
// PreparedStatement psNoise = null;
// PreparedStatement psRiver = null;
// PreparedStatement psForest = null;
PreparedStatement psAllTags = null; PreparedStatement psAllTags = null;
ResultSet rsBrouter = null; ResultSet rsBrouter = null;
@ -209,11 +212,13 @@ public class OsmCutter extends MapCreatorBase {
System.err.println("OsmCutter connect to the database ok........"); System.err.println("OsmCutter connect to the database ok........");
} catch (SQLException g) { } catch (SQLException g) {
System.err.format("Osm Cutter SQL State: %s\n%s", g.getSQLState(), g.getMessage()); System.err.format("Osm Cutter SQL State: %s\n%s\n", g.getSQLState(), g.getMessage());
System.exit(0); System.exit(1);
return;
} catch (Exception f) { } catch (Exception f) {
f.printStackTrace(); f.printStackTrace();
System.exit(0); System.exit(1);
return;
} }
} }
@ -261,11 +266,11 @@ public class OsmCutter extends MapCreatorBase {
} }
} catch (SQLException g) { } catch (SQLException g) {
System.err.format(" OsmCutter execute sql .. SQL State: %s\n%s", g.getSQLState(), g.getMessage()); System.err.format(" OsmCutter execute sql .. SQL State: %s\n%s\n", g.getSQLState(), g.getMessage());
System.exit(0); System.exit(1);
} catch (Exception f) { } catch (Exception f) {
f.printStackTrace(); f.printStackTrace();
System.exit(0); System.exit(1);
} }
return; return;