Package org.sqlite.util
Class QueryUtils
- java.lang.Object
-
- org.sqlite.util.QueryUtils
-
public class QueryUtils extends Object
-
-
Constructor Summary
Constructors Constructor Description QueryUtils()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static Stringescape(String val, char quote)Escapes a value for use between the given SQL quote characters, by doubling every occurrence of the quote character.static StringquoteIdentifier(String val)Quotes a value as a SQLite identifier, so that it is always read as a single identifier.static StringvaluesQuery(List<String> columns, List<List<Object>> valuesList)Build a SQLite query using the VALUES clause to return arbitrary values.
-
-
-
Method Detail
-
escape
public static String escape(String val, char quote)
Escapes a value for use between the given SQL quote characters, by doubling every occurrence of the quote character.- Parameters:
val- the value to escape, may be nullquote- the quote character the value will be wrapped in,'for a string literal or"for an identifier- Returns:
- the escaped value, or null if
valis null
-
quoteIdentifier
public static String quoteIdentifier(String val)
Quotes a value as a SQLite identifier, so that it is always read as a single identifier.- Parameters:
val- the identifier to quote- Returns:
- the double quoted identifier
-
-