How to delete ORMLite database?

I would like to know how to delete a database using ORMLite. Is there any API call?

Simply deleting all tables does not delete the entire database.

Thanks in advance.

+5
source share
2 answers

Edit:

Sounds like you got it. You are doing something like:

boolean success =
    context.deleteDatabase(
        "/data/data/source.package.goes.here/databases/database-name.db‌​");

Edit:

Deleting a database is weird with ORMLite, but I think it can be done. Indeed, when you execute a method dao.executeRaw(...), you have a connection open to the database engine that can perform almost any operation. You should have something like:

fooDao.executeRaw("drop database foo;");

This at least works for me under MySQL, and it should be under Sqlite.


, ORMLite TableUtils, :

http://ormlite.com/docs/table-utils

javadocs .

+4

All Articles