SQLiteDatabase getPath - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for SQLiteDatabase getPath method.

This code example shows how to use the following methods: getPath, rawQuery
             } 
        } 
 
        @Override 
        public void onOpen(SQLiteDatabase db) {
            debug("Opening tabs.db: " + db.getPath());
 
            Cursor cursor = null;
            try { 
                cursor = db.rawQuery("PRAGMA synchronous=OFF", null);
            } finally { 
                if (cursor != null)
                    cursor.close();
            } 
 
            // From Honeycomb on, it's possible to run several db 
            // commands in parallel using multiple connections. 
            if (Build.VERSION.SDK_INT >= 11) {
                db.enableWriteAheadLogging();
                db.setLockingEnabled(false);

7
CodeRank
Stop searching for code, let great code find you!  Add Codota to your java IDE
This code example shows how to use the following methods: getPath
 
	@Override 
	public void onCreate(SQLiteDatabase db) {
		//TODO currently defers creation of database to SchemaCreationPolicy. 
		// and does not create database here. 
		Log.warn("Orman: SQLite database onCreate invoked. Database path %s.", db.getPath());
	} 
 
	@Override 
	public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {
		Log.warn("onUpgrade"); 
		Log.info( 
				"Orman: SQLite database onUpgrade invoked. Database path %s. Old %d, new %d.", 
				db.getPath(), oldVersion, newVersion);
	} 
 
	@Override 
	public QueryExecutionContainer getExecuter() { 
		return executer;
	} 
Full Snippet Info
6
CodeRank
Stop searching for code, let great code find you!  Add Codota to your java IDE
This code example shows how to use the following methods: close, getPath, query
    public static boolean setVersion(String version) {
        if (database != null) {
            if (databaseVersion.equals(version)) {
                return true; 
            } 
            Log.d(TAG, "close database \"" + database.getPath() + "\"");
            database.close();
        } 
 
        if (!setDatabasePath()) { 
            return false; 
        } 
        File file = new File(databasePath, version + ".sqlite3");
        if (file.exists() && file.isFile()) {
            databaseVersion = version;
            Log.d(TAG, "open database \"" + file.getAbsolutePath() + "\"");
            database = SQLiteDatabase.openDatabase(file.getAbsolutePath(), null,
                    SQLiteDatabase.OPEN_READONLY | SQLiteDatabase.NO_LOCALIZED_COLLATORS);
            setBooks(); 
            return true; 
Full Snippet Info
5
CodeRank
Stop searching for code, let great code find you!  Add Codota to your java IDE
This code example shows how to use the following methods: execSQL, getPath
		context = _context;
		//开启数据库 
		  
		db = context.openOrCreateDatabase(DATABASE_NAME, Context.MODE_PRIVATE,null);
		CreateTable(); 
		Log.v(TAG, "db path=" + db.getPath());
	} 
 
	/** 
	 * t_gprsData 记录数据变动 
	 * savetime 保存的时间,时间戳 
	 * gprsValue gprs流量的数据 
	 * totalValue 总流量的数据 
	 * action 执行的类型 1-正常保存,2-开机后第一次保存 
	 * notes 预留 
	 * 建表 
	 * 列名 区分大小写? 
	 * 都有什么数据类型? 
	 * SQLite 3  
	 * 	TEXT    文本 

5
CodeRank
Stop searching for code, let great code find you!  Add Codota to your java IDE
This code example shows how to use the following methods: getPath
		createTables(database);
	} 
 
	public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion)
	{ 
		Log.w(db.getPath(), "Upgrading database from version " + oldVersion + " to " + newVersion + ", which will destroy all old data");
		 
		dropTables(database);
		createTables(database);
	} 
	 
	public void startTransaction() 
	{ 
		database.beginTransaction();
	} 
	 
	public void commitTransaction() 
	{ 
		database.setTransactionSuccessful();
		database.endTransaction();
Full Snippet Info
5
CodeRank
Stop searching for code, let great code find you!  Add Codota to your java IDE

Related SQLiteDatabase getPath Questions & Answers:

getPath Method Overview
Gets the path to the database file.
See Code Examples for other Android SQLiteDatabase Methods: