public class MSql extends Object
| Modifier and Type | Class and Description |
|---|---|
static class |
MSql.SqlTranslator |
| Constructor and Description |
|---|
MSql() |
| Modifier and Type | Method and Description |
|---|---|
static String |
encode(String string,
boolean notNull)
Prepare a string to use it in a sql query.
|
static String |
escape(String in)
Escape all single quots to double single quots.
|
static String |
escape(String in,
int truncateSize)
Escape single quots and truncates the string is needed.
|
static void |
executeUpdateQueries(Statement sth,
String sql)
Executes a bundle of queries, separated by semicolon.
|
static void |
fillProperties(ResultSet res,
MProperties prop) |
static void |
fillProperties(ResultSet res,
MProperties prop,
MSql.SqlTranslator translator) |
static String |
quoteSQL(String sql)
used to prepare SQL string literals by doubling each embedded ' and
wrapping in ' at each end.
|
static String |
toSqlLabel(String in,
Connection con)
Removes all non standard characters.
|
static String |
unescape(String in)
Remove all double single quots.
|
public static String encode(String string, boolean notNull)
string - notNull - Set to true will return a single space instead of the string NULLpublic static String escape(String in)
in - public static String escape(String in, int truncateSize)
in - truncateSize - public static void executeUpdateQueries(Statement sth, String sql) throws SQLException
sth - sql - SQLExceptionpublic static String quoteSQL(String sql)
sql - Raw SQL string literalpublic static String toSqlLabel(String in, Connection con)
in - The string to validatecon - Optional the sql connection to validate keywords. null is possible.public static void fillProperties(ResultSet res, MProperties prop) throws SQLException, de.mhus.lib.errors.MException
SQLExceptionde.mhus.lib.errors.MExceptionpublic static void fillProperties(ResultSet res, MProperties prop, MSql.SqlTranslator translator) throws SQLException, de.mhus.lib.errors.MException
SQLExceptionde.mhus.lib.errors.MExceptionCopyright © 2014. All rights reserved.