新加了一个iIMAGE以后数据库报错,只有图中这么一行错
下面是我数据库的代码
package com.mlchelper.db;
import java.sql.Blob;
import com.mlchelper.dom.Infor_table;
import android.content.ContentValues;
import android.content.Context;
import android.database.Cursor;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteException;
import android.database.sqlite.SQLiteOpenHelper;
import android.database.sqlite.SQLiteDatabase.CursorFactory;
import android.widget.EditText;
public class DBInfor {
private static final String DB_NAME = "person.db";
private static final String PERSON_TABLE = "peopleinfo";
private static final int DB_VERSION = 1;
public static final String in_ID = "_id";
public static final String iPHONE="pnumber";
public static final String iNAME="username";
public static final String iPASSWORD="password";
public static final String iHOBBY="hobby";
public static final String iBIRTH="birth";
public static final String iIMAGE="touxiang";
private SQLiteDatabase db;
private final Context context;
private DBOpenHelper dbOpenHelper;
public DBInfor(Context _context) {
context = _context;
}
/** Close the database */
public void close() {
if (db != null){
db.close();
db = null;
}
}
/** Open the database */
public void open() throws SQLiteException {
dbOpenHelper = new DBOpenHelper(context, DB_NAME, null, DB_VERSION);
try {
db = dbOpenHelper.getWritableDatabase();
}
catch (SQLiteException ex) {
db = dbOpenHelper.getReadableDatabase();
}
}
/*
/*
查询全部表格信息
*/
public Infor_table[] queryAllData(){
Cursor results=db.query(PERSON_TABLE, new String[]{in_ID,iPHONE,iNAME,iBIRTH,iHOBBY,iPASSWORD,iIMAGE}, null,null,null, null, iNAME);
return ConvertToPeople(results);
}
/*
public Infor_table[] ConvertToPeople(Cursor cursor){
int resultCounts=cursor.getCount();
if(resultCounts==0||!cursor.moveToFirst()){
return null;
}
Infor_table[] person=new Infor_table[resultCounts];
for (int i = 0; i < resultCounts; i++) {
person[i]=new Infor_table();
person[i].ID = cursor.getInt(cursor.getColumnIndex(iNAME));
person[i].phonenumber=cursor.getInt(cursor.getColumnIndex(iPHONE));
person[i].username=cursor.getString(cursor.getColumnIndex(iNAME));
person[i].birth=cursor.getString(cursor.getColumnIndex(iBIRTH));
person[i].hobby=cursor.getString(cursor.getColumnIndex(iHOBBY));
person[i].password=cursor.getString(cursor.getColumnIndex(iPASSWORD));
person[i].image=cursor.getString(cursor.getColumnIndex(iIMAGE));
cursor.moveToNext();
}
return person;
}
/*
}
/*
public void updatePoint(int idPoint,
int ColumnNr, int Column, int lamp, int armor, int lampState){
String where = "id=?";
String[] whereArgs = new String[] {String.valueOf(idPoint)};
ContentValues values = new ContentValues();
values.put(PointsDB.COLUMNNR, ColumnNr);
values.put(PointsDB.COLUNA, Column);
values.put(PointsDB.LAMP, lamp);
values.put(PointsDB.ARMOR, armor);
values.put(PointsDB.LAMPSTATE, lampState);
database.update(PointsDB.TABLE_NAME, values, where, whereArgs);
}
*/
/** 静态Helper类,用于建立、更新和打开数据库*/
private static class DBOpenHelper extends SQLiteOpenHelper {
public DBOpenHelper(Context context, String name, CursorFactory factory, int version) {
super(context, name, factory, version);
}
private static final String PERSON_CREATE = "create table " + PERSON_TABLE + " (" + in_ID + " integer primary key autoincrement, "+
iPHONE + " integer, " + iNAME+" text not null, " + iBIRTH+" text,"+iHOBBY +" text, "+
iIMAGE + " text, " + iPASSWORD+" text not null);";
@Override
public void onCreate(SQLiteDatabase _db) {
_db.execSQL(PERSON_CREATE);
_db.execSQL("insert into peopleinfo (_id,username,password,birth,hobby,pnumber,touxiang) values (1,'admin','password','1995-1-30','reading','676552',null)");
}
@Override
public void onUpgrade(SQLiteDatabase _db, int _oldVersion, int _newVersion) {
_db.execSQL("DROP TABLE IF EXISTS " + PERSON_TABLE);
onCreate(_db);
}
}
}
经过google后,只需要简单设置模拟器的一个选项即可:在模拟器配置信息弹框中勾选 “Use Host GPU”转自:http://stackoverflow.com/questions/21845358/android-emulator-cant-be-started......
答案就在这里:Android 模拟器启动报错:android failed to open framebuffer ( no such file or directory )
----------------------你好,人类,我是来自CSDN星球的问答机器人小C,以上是依据我对问题的理解给出的答案,如果解决了你的问题,望采纳。
检查下,没有这一列