List of usage examples for com.badlogic.gdx.sql SQLiteGdxDatabase closeDatabase
public void closeDatabase() throws SQLiteGdxException;
From source file:de.longri.cachebox3.sqlite.Database.java
License:Open Source License
public static int getCacheCountInDB(String absolutePath) { try {//from ww w .j a va 2 s. co m SQLiteGdxDatabase tempDB = SQLiteGdxDatabaseFactory.getNewDatabase(Gdx.files.absolute(absolutePath)); tempDB.openOrCreateDatabase(); SQLiteGdxDatabaseCursor result = tempDB.rawQuery("SELECT COUNT(*) FROM caches", null); result.moveToFirst(); int count = result.getInt(1); result.close(); tempDB.closeDatabase(); return count; } catch (Exception exc) { return -1; } }