Java tutorial
//package com.java2s; import android.database.sqlite.SQLiteStatement; import android.support.annotation.Nullable; public class Main { /** * Binds the string or null value to an statement. * * @param statement The statement. * @param index The index to bind. * @param value The value to bind. */ public static void bindStringOrNull(SQLiteStatement statement, int index, @Nullable String value) { if (value != null) { statement.bindString(index, value); } else { statement.bindNull(index); } } }