· 8 years ago · Apr 02, 2018, 01:52 AM
1public void excluir (int codigo){
2
3 String[] parametros = new String[1];
4 parametros[0] = String.valueOf(codigo);
5
6 conexao.delete("CLIENTE", "CODIGO = ? ", parametros);}
7
8public void tirar (View view){
9 int x = 1;
10 ClienteRepositorio clienteRepositorio = new ClienteRepositorio(conexao);
11 clienteRepositorio.excluir(x);
12 onResume();
13
14}
15
16public class ScriptDLL {
17
18public static String getCreateTableCliente(){
19 StringBuilder sql = new StringBuilder();
20 sql.append(" CREATE TABLE IF NOT EXISTS CLIENTE (");
21 sql.append(" CODIGO INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL,");
22 sql.append(" NOME VARCHAR (250) NOT NULL DEFAULT (''),");
23 sql.append(" ENDERECO VARCHAR (255) NOT NULL DEFAULT (''),");
24 sql.append(" EMAIL VARCHAR (200) NOT NULL DEFAULT (''),");
25 sql.append(" TELEFONE VARCHAR (20) NOT NULL DEFAULT ('') )");
26 return sql.toString();
27}
28
29}