Example usage for android.database DatabaseUtils appendValueToSql

List of usage examples for android.database DatabaseUtils appendValueToSql

Introduction

In this page you can find the example usage for android.database DatabaseUtils appendValueToSql.

Prototype

public static final void appendValueToSql(StringBuilder sql, Object value) 

Source Link

Document

Appends an Object to an SQL string with the proper escaping, etc.

Usage

From source file:com.eTilbudsavis.etasdk.DbHelper.java

private static String escape(Object o) {

    if (o instanceof Integer) {
        return Integer.toString((Integer) o);
    }/*from www  .  j ava  2s .co  m*/

    StringBuilder sb = new StringBuilder();
    DatabaseUtils.appendValueToSql(sb, o);
    return sb.toString();
}