List of usage examples for com.badlogic.gdx.sql SQLiteGdxDatabase openOrCreateDatabase
public void openOrCreateDatabase() throws SQLiteGdxException;
From source file:de.longri.cachebox3.sqlite.Database.java
License:Open Source License
public static int getCacheCountInDB(String absolutePath) { try {/*from www . jav a 2 s . c o 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; } }