Android examples for Database:SQL Statement
Concatenates two SQL WHERE clauses, handling empty or null values.
//package com.book2s; import android.text.TextUtils; public class Main { /**/*from w w w. ja va 2s . c o m*/ * Concatenates two SQL WHERE clauses, handling empty or null values. */ public static String concatenateWhere(String a, String b) { if (TextUtils.isEmpty(a)) { return b; } if (TextUtils.isEmpty(b)) { return a; } return "(" + a + ") AND (" + b + ")"; } }