import java.util.*;
import java.sql.*;

public class test {
  public static void main(String[] args){
    System.out.println("hoge");
    DBAccessor db = DBAccessor.createInstance("org.sqlite.JDBC","jdbc:sqlite:resource/test.db3","","");
    new test().writeDB();
    db.commit();
    
  }
  
  public int add(int a, int b){
    return a+b;
  }
  
  public int divide(int a, int b){
    return a/b;
  }
  
  public ArrayList<HashMap> readDB(){
    DBAccessor db = new DBAccessor("org.sqlite.JDBC","jdbc:sqlite:resource/test.db3","","");
    
    db.close();
    return null;
  }
  
  public boolean writeDB(){
    DBAccessor db = DBAccessor.getInstance();
    try {
      PreparedStatement st = db.prepareStatement("insert into test1 values ('101', 'test100')");
      System.out.println("update num = " + st.executeUpdate());
      db.close(st);
    } catch (Exception e){
      e.printStackTrace();
      return false;
    }
    return true;
  }
}