public class DBhelper extends SQLiteOpenHelper {
private static final String DATABASE_NAME = "TenDigiDataBase";
private static final String DateEntry_Table = "dataentry";
public static final String KEY_ROWID = "_id";
public static final String KEY_CMOBILENUMBER = "cmobilenumber";
public static final String KEY_CPLAN = "cplan";
public static final String KEY_CFRUVALUE = "cfruvalue";
public static final String KEY_DATACARDIMEINUMBER = "datacardimeinumber";
public static final String KEY_AMOUNT = "amount";
public static final String KEY_CNAME = "cname";
public static final String KEY_FATHERNAME = "cfathername";
public static final String KEY_DATEOFBIRTH = "cdateofbirth";
public static final String KEY_PROOFOFIDENTRYTYPE = "cproofofindentytype";
public static final String KEY_OF_IDENTY_NUMBER = "cofidentynumber";
public static final String KEY_PROOF_OF_ADDRESSTYPE = "kproofofadress";
public static final String KEY_PROOF_OF_ADDRESsNUMBER = "kproofofadressnumber";
public static final String KEY_C_SIGNED_NAME = "signesname";
public static final String KEY_MRSIGNES_NAME = "mrsignedname";
public static final String KEY_CSIGNES_POI_POA = "poipoaimage";
private static final int DATABASE_VERSION = 1;
SQLiteDatabase db;
Cursor cursor;
byte[] byteImage2 = null;
public DBhelper(Context context) {
super(context, DATABASE_NAME, null, 4);
}
@Override
public void onCreate(SQLiteDatabase db) {
db.execSQL("CREATE TABLE " + DateEntry_Table
+ "(" + KEY_ROWID + " INTEGER PRIMARY KEY NOT NULL,"
+ KEY_CMOBILENUMBER + " text,"
+ KEY_CPLAN + " text, "
+ KEY_CFRUVALUE + " text, "
+ KEY_DATACARDIMEINUMBER + " text, "
+ KEY_AMOUNT + " text, "
+ KEY_CNAME + " text, "
+ KEY_FATHERNAME + " text, "
+ KEY_DATEOFBIRTH + " text, "
+ KEY_PROOFOFIDENTRYTYPE + " text, "
+ KEY_OF_IDENTY_NUMBER + " text, "
+ KEY_PROOF_OF_ADDRESSTYPE + " text, "
+ KEY_PROOF_OF_ADDRESsNUMBER + " text, "
+ KEY_C_SIGNED_NAME + "BLOB,"
+ KEY_MRSIGNES_NAME + "BLOB,"
+ KEY_CSIGNES_POI_POA + "BLOB)");
System.out.println("Database Createeeeeeeeeeeeeee");
}
@Override
public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {
db.execSQL("drop table if exists " + DateEntry_Table);
onCreate(db);
}
public void insertData(String id,
String cmobilenumber,
String cplan,
String cfruvalue,
String datacardimeinumber,
String amountpiad,
String cname,
String cfathername,
String cdateofbirth,
String cproofofindentytype,
String cofidentynumber,
String kproofofadress,
String proofodadressnumber
, Bitmap signesname
, Bitmap mrsignedname
, Bitmap poipoaimage)
{
db = this.getWritableDatabase();
ContentValues cv = new ContentValues();
cv.put(KEY_ROWID, id);
cv.put(KEY_CMOBILENUMBER, cmobilenumber);
cv.put(KEY_CPLAN, cplan);
cv.put(KEY_CFRUVALUE, cfruvalue);
cv.put(KEY_DATACARDIMEINUMBER, datacardimeinumber);
cv.put(KEY_AMOUNT, amountpiad);
cv.put(KEY_CNAME, cname);
cv.put(KEY_FATHERNAME, cfathername);
cv.put(KEY_DATEOFBIRTH, cdateofbirth);
cv.put(KEY_PROOFOFIDENTRYTYPE, cproofofindentytype);
cv.put(KEY_OF_IDENTY_NUMBER, cofidentynumber);
cv.put(KEY_PROOF_OF_ADDRESSTYPE, kproofofadress);
cv.put(KEY_PROOF_OF_ADDRESsNUMBER, proofodadressnumber);
cv.put(KEY_C_SIGNED_NAME, Utility.getBytes(signesname));
cv.put(KEY_MRSIGNES_NAME, Utility.getBytes(mrsignedname));
cv.put(KEY_CSIGNES_POI_POA, Utility.getBytes(poipoaimage));
db.insertWithOnConflict(DateEntry_Table, KEY_ROWID, cv,
SQLiteDatabase.CONFLICT_REPLACE);
}
例外:
android.database.sqlite.SQLiteException:table dataentry没有名为mrsignedname(code 1)的列:,编译时:INSERT OR REPLACE INTO dataentry(mrsignedname,kproofofadressnumber,cproofofindentytype,amount,cfathername,cmobilenumber,cdateofbirth,_id,cofidentynumber ,datacardimeinumber,signesname,cfruvalue,kproofofadress,cname,cplan,poipoaimage)VALUES(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)< / p>
当我尝试将数据插入表格时我得到了我发布的那个例外,但我不知道在哪里做雾化而我已经卸载然后再次安装应用程序然后我尝试插入数据我不知道哪里做错了请建议我在哪里做错了。