public static void insert( int codigoPlanilha, String descricao, float valor, int tipoOperacao, String data, int parcelas, int ativo) { // SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd"); // Calendar calendar = Calendar.getInstance(); // String data = formatter.format(calendar.getTime()); String query = "insert into Operacoes(ope_descricao,ope_codigo_pla,ope_valor, ope_codigo_top, ope_data,ope_parcelas,ope_ativo) values ('" + descricao + "'," + codigoPlanilha + "," + valor + "," + tipoOperacao + ",'" + data + "'," + parcelas + "," + ativo + ")"; Database.run(query); }
public static void delete() { String query = "DROP TABLE Operacoes"; Database.run(query); }
public static void create() { String query = "create table if not exists Operacoes (ope_codigo integer primary key autoincrement, ope_descricao varchar, ope_codigo_pla int, ope_valor float, ope_codigo_top int, ope_data date, ope_parcelas int, ope_ativo int)"; Database.run(query); }