public class MSql extends Object
MSql class.
| 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)
fillProperties.
|
static void |
fillProperties(ResultSet res,
MProperties prop,
MSql.SqlTranslator translator)
fillProperties.
|
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)
public static String escape(String in, int truncateSize)
public static void executeUpdateQueries(Statement sth, String sql) throws SQLException
sth - a Statement object.sql - a String object.SQLException - if any.public 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.String object.public static void fillProperties(ResultSet res, MProperties prop) throws SQLException, MException
fillProperties.
res - a ResultSet object.prop - a MProperties object.SQLException - if any.MException - if any.public static void fillProperties(ResultSet res, MProperties prop, MSql.SqlTranslator translator) throws SQLException, MException
fillProperties.
res - a ResultSet object.prop - a MProperties object.translator - a MSql.SqlTranslator object.SQLException - if any.MException - if any.Copyright © 2016. All Rights Reserved.