- /**
- *判断某张表是否存在
- *@paramtabName表名
- *@return
- */
- publicbooleantabbleIsExist(StringtableName){
- booleanresult=false;
- if(tableName==null){
- return }
- sqliteDatabasedb=null;
- Cursorcursor=try{
- db=this.getReadableDatabase();
- Stringsql="selectcount(*)ascfromsqlite_masterwheretype='table'andname='"+tableName.trim()+"'";
- cursor=db.rawQuery(sql,null);
- if(cursor.moveToNext()){
- intcount=cursor.getInt(0);
- if(count>0){
- result=true;
- }catch(Exceptione){
- //TODO:handleexception
- returnresult;
- }