How to check existing database before creating new database on android 2.2?

前端 未结 4 757
没有蜡笔的小新
没有蜡笔的小新 2021-01-22 12:48

I need to check existing database before creating new database on android 2.2. How to check it?

4条回答
  •  夕颜
    夕颜 (楼主)
    2021-01-22 13:04

    You should need to check database already exists or not, if not than create database else not create database. Please you can use below query.

    CREATE TABLE if not exists TABLE_NAME (key data_type);

    Call this query inside onCreate method.

提交回复
热议问题