sqlite3(3)
-
SQLiteOpenHelper 를 이용한 SQLite3 제어
# SQLiteOpenHelper 상속 받은 객체 생성 public class WYSQLiteOpenHelper extends SQLiteOpenHelper { public static final int DATABASE_VERSION = 1; public static final String DATABASE_NAME = "wy_database.db3"; private static final String SQL_CREATE = "CREATE TABLE IF NOT EXISTS tb_wy (" + "uid INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT," + "title TEXT NOT NULL)"; private static final String SQL_DELETE = "DR..
2020.07.23 -
[PHP] SQLite3 Escape String
# PHP 5 = 1.0.0 // 사용법 // sqlite_escape_string ( string $item ) : string echo sqlite_escape_string('Hello "World" \'\' ...'); // output // Hello "World" '''' ... # (PHP 5 >= 5.3.0, PHP 7) // Description // public static SQLite3::escapeString ( string $value ) : string echo SQLite3::escapeString('Hello "World" \'\' ...'); // output // Hello "World" '''' ... SQLite3에 사용될 쿼리문을..
2020.07.15 -
SQLiteDatabase 를 이용한 SQLite 사용하기
1. SQLiteDatabase 생성(Create) 및 열기(Open) SQLiteDatabase database = openOrCreateDatabase("database.db3", MODE_WORLD_WRITEABLE, null); 2. 쿼리 실행(CREATE, INSERT, UPDATE, DELETE 실행시) database.beginTransaction(); try{ database.execSQL(strSQL); database.setTransactionSuccessful(); }catch(Exception e){ e.printStackTrace(); }finally{ database.endTransaction(); } 3. 쿼리실행(SELECT 실행시) Cursor cursor = null; t..
2020.05.21