Android的 - 难道SQLite数据库存在吗? [英] Android - Does SQLite Database Exist?

查看:115
本文介绍了Android的 - 难道SQLite数据库存在吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何才能快速地检查数据库存在于Android的?

How can I quickly check if a database exists in Android?

(不是表 - 整个数据库)

(not a Table - the entire database)

推荐答案

打开数据库并赶上这将在情况下被抛出,如果数据库中不存在的SQLitException。需要注意的是,你不应该叫 openOrCreateDatabase()方法。看到这个职位的详细信息; 查询,如果Android的数据库存在!

Open your database and catch the SQLitException which will be thrown in case if database doesn't exist. Note that, you should not call the openOrCreateDatabase() method. See this post for details; Query if Android database exists!

这篇关于Android的 - 难道SQLite数据库存在吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆