/***判断某张表是否存在*@paramtabName表名*@return*/publicbooleantabIsExist(StringtabName){booleanresult=false;if(tabName==null){returnfalse;}SQLiteDatabasedb=null;Cursorcursor=null;try{db=this.getReadableDatabase();//此this是继承SQLiteOpenHelper类得到的Stringsql=selectcount(*)ascfromsqlite_masterwheretype='table'andname='+tabName.trim()+';cursor=db.rawQuery(sql,null);if(cursor.moveToNext()){intcount=cursor.getInt(0);if(count>0){result=true;}}}catch(Exceptione){//TODO:handleexception}returnresult;}