Slide 57
Slide 57 text
HTC Proprietary and Confidential
57
Prepared Statements
• Precompiling frequently used SQL statements
String sql = “INSERT INTO table VALUES (?, ?)”;!
SQLiteStatement stmt = mDatabase.compileStatement(sql);!
!
DatabaseUtils.bindObjectToProgram(stmt, 1, 1);!
DatabaseUtils.bindObjectToProgram(stmt, 2, 2);!
!
stmt.execute();!
stmt.close();!