fixed: -update オプションが効いていない
1 parent e8a335d commit 179aa17f49cedb82efd1de51161ecb9698a8d5b5
@hayashi hayashi authored on 16 Sep 2017
Showing 1 changed file
View
14
src/osm/jp/coverage/fuel/DbFuel.java
* @throws javax.xml.parsers.ParserConfigurationException
* @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ディレクトリがなければエラー
File dbdir = new File("database");
Connection conPost = null;
try {
// DB.tableを作成
con = DatabaseTool.openDb("database");
create(con);
if (!UPDATE) {
create(con);
}
try (PreparedStatement ps = con.prepareStatement("DELETE FROM "+ TABLE_NAME)) {
ps.executeUpdate();
}