| |
---|
| | * @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(); |
---|
| | } |
---|
| |
---|
| | |