package
com.db.imgfornote;
import
android.content.ContentValues;
android.content.Context;
android.database.Cursor;
android.util.Log;
final
private
static
String mDbName=
"imgfornote"
;
static
int
mDbVersion=
1
;
static
DBHelper mInstance=
null
;
String mTUserPhoto=
"UserPhoto"
;
String mCreatesqlForNoteClass=
"create table if not exists NoteClass(classId integer primary key asc autoincrement,className NVARCHAR(100),rowTime timestamp default (datetime('now','localtime')))"
;
String mCreatesqlForUserPhoto=
"create table if not exists UserPhoto(photoId integer primary key asc autoincrement,photoName VARCHAR(200),userPt VARCHAR(200),title VARCHAR(255),classId integer,content NVARCHAR(250),tag NVARCHAR(200),remark text,status integer default 0,182)!important; background:none!important">;
String[] mInsertsqlForNoteClass={
"insert into NoteClass(className) values('默认分类[私有]');"
,
"insert into NoteClass(className) values('读书笔记[私有]');"
"insert into NoteClass(className) values('电子资料[公开]');"
};
private
DBHelper(Context context,CursorFactory factory) {
super
(context,mDbName,factory,mDbVersion);
}
DBHelper GetInstance(Context context,sqliteDatabase.CursorFactory factory)
{
if
(mInstance==
){
mInstance =
new
DBHelper(context,factory);
}
return
mInstance;
}
@Override
onCreate(sqliteDatabase db) {