阅读背景:

Android数据库的增删改查和ListView以及页面跳转的实现

来源:互联网 

不多说甚么,直接看代码:先创立一个person实体对象。
import java.io.Serializable;

public class Person implements Serializable{
	private static final long serialVersionUID=1L;
	private Integer id;
	private String name;
	private String phone;
	private Integer amount;
	public Integer getId() {
		return id;
	}
	public void setId(Integer id) {
		this.id = id;
	}
	public String getName() {
		return name;
	}
	public void setName(String name) {
		this.name = name;
	}
	public String getPhone() {
		return phone;
	}
	public void setPhone(String phone) {
		this.phone = phone;
	}
	public Integer getAmount() {
		return amount;
	}
	public void setAmount(Integer amount) {
		this.amount = amount;
	}
	public Person(String name, String phone, Integer amount) {
		super();
		this.name = name;
		this.phone = phone;
		this.amount = amount;
	} 
	public Person(int id,String name, String phone, Integer amount) {
		super();
		this.id=id;
		this.name = name;
		this.phone = phone;
		this.amount = amount;
	} 

	

<h2>}
<span>创立DBOpenHelper类通过继承SQLiteOpenHelper类来实现数据库的创立和更新。重写SQLiteOpenHelper 的onCreate、onUpgrade办法</span></h2>import java.io.Serial




你的当前访问异常,请进行认证后继续阅读剩余内容。

分享到: