|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.clazzes.jdbc2xml.helper.SQLHelper
public abstract class SQLHelper
Helper functions common for many SQL engines.
Constructor Summary | |
---|---|
SQLHelper()
|
Method Summary | |
---|---|
static void |
appendTypePrec(StringBuffer sb,
String type,
Integer prec)
Append an SQL type name together with a precision to a string buffer. |
static void |
appendTypePrecScale(StringBuffer sb,
String type,
Integer prec,
Integer scale)
Append an SQL type name together with a precision and a scale to a string buffer. |
static void |
copyResultField(PreparedStatement ps,
int pc,
ResultSet rs,
int rc)
Copies a column from a result set to a placeholder of a PreparedStatment. |
static void |
executeUpdate(Connection connection,
String sql)
Perform an SQL update statement. |
static String |
joinIdentifiers(Collection<String> strings,
SqlIdentifierMapper mapper)
Simply concatenate a collection of SQL identifiers by using a comma as separator. |
static void |
joinIdentifiers(StringBuffer sb,
Collection<String> strings,
SqlIdentifierMapper mapper)
Simply concatenate a collection of SQL identifiers by using a comma as separator. |
static void |
quoteISOSqlString(StringBuffer sb,
String s)
Quote the given string as defined by ISO SQL by doubling single quotes. |
static String |
unquoteISOSqlString(String s)
Unquote the given string as defined by ISO SQL by doubling single quotes. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public SQLHelper()
Method Detail |
---|
public static void quoteISOSqlString(StringBuffer sb, String s)
sb
- The buffer to put the result to.s
- The String to quote.unquoteISOSqlString
public static String unquoteISOSqlString(String s)
s
- The String to unquote.
quoteISOSqlString
public static void appendTypePrec(StringBuffer sb, String type, Integer prec)
sb
- The buffer to put the result to.type
- The SQL name of the type.prec
- The optional precision (field width).public static void appendTypePrecScale(StringBuffer sb, String type, Integer prec, Integer scale)
sb
- The buffer to put the result to.type
- The SQL name of the type.prec
- The optional precision (field width).scale
- The optional scale (fractional digits).public static void executeUpdate(Connection connection, String sql) throws SQLException
connection
- The JDBC connection to use.sql
- The SQL update statement.
SQLException
- Upon database errorsStatement.executeUpdate(String)
public static void copyResultField(PreparedStatement ps, int pc, ResultSet rs, int rc) throws SQLException
ps
- The prepared statement.pc
- The column number of the column to be filled.rs
- The result set from which to retrieve the data.rc
- The column of the result set to be evaluated.
SQLException
public static void joinIdentifiers(StringBuffer sb, Collection<String> strings, SqlIdentifierMapper mapper)
sb
- The string buffer to write the concatenated list of string to.strings
- A collection of strings.mapper
- A mapper for transforming SQL identifiers to their external form.public static String joinIdentifiers(Collection<String> strings, SqlIdentifierMapper mapper)
strings
- A collection of strings.mapper
- A mapper for transforming SQL identifiers to their external form.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |