diff --git a/src/osm/jp/coverage/fuel/DbFuel.java b/src/osm/jp/coverage/fuel/DbFuel.java index 23984ac..6c9e92c 100644 --- a/src/osm/jp/coverage/fuel/DbFuel.java +++ b/src/osm/jp/coverage/fuel/DbFuel.java @@ -31,8 +31,10 @@ * @throws org.xml.sax.SAXException */ public static void main(String[] args) throws FileNotFoundException, ClassNotFoundException, IOException, SQLException, ParserConfigurationException, SAXException { - if ((args.length > 1) && args[0].equals("-update")) { - UPDATE = true; + for (String arg : args) { + if (arg.toUpperCase().equals("-UPDATE")) { + UPDATE = true; + } } // HSQLディレクトリがなければエラー @@ -46,7 +48,9 @@ try { // DB.tableを作成 con = DatabaseTool.openDb("database"); - create(con); + if (!UPDATE) { + create(con); + } try (PreparedStatement ps = con.prepareStatement("DELETE FROM "+ TABLE_NAME)) { ps.executeUpdate();