|
||||||||||
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(java.lang.StringBuffer sb,
java.lang.String type,
java.lang.Integer prec)
Append an SQL type name together with a precision to a string buffer. |
static void |
appendTypePrecScale(java.lang.StringBuffer sb,
java.lang.String type,
java.lang.Integer prec,
java.lang.Integer scale)
Append an SQL type name together with a precision and a scale to a string buffer. |
static void |
copyResultField(java.sql.PreparedStatement ps,
int pc,
java.sql.ResultSet rs,
int rc)
Copies a column from a result set to a placeholder of a PreparedStatment. |
static void |
executeUpdate(java.sql.Connection connection,
java.lang.String sql)
Perform an SQL update statement. |
static java.lang.String |
joinIdentifiers(java.util.Collection<java.lang.String> strings,
SqlIdentifierMapper mapper)
Simply concatenate a collection of SQL identifiers by using a comma as separator. |
static void |
joinIdentifiers(java.lang.StringBuffer sb,
java.util.Collection<java.lang.String> strings,
SqlIdentifierMapper mapper)
Simply concatenate a collection of SQL identifiers by using a comma as separator. |
static void |
quoteISOSqlString(java.lang.StringBuffer sb,
java.lang.String s)
Quote the given string as defined by ISO SQL by doubling single quotes. |
static java.lang.String |
unquoteISOSqlString(java.lang.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(java.lang.StringBuffer sb, java.lang.String s)
sb
- The buffer to put the result to.s
- The String to quote.unquoteISOSqlString
public static java.lang.String unquoteISOSqlString(java.lang.String s)
s
- The String to unquote.
quoteISOSqlString
public static void appendTypePrec(java.lang.StringBuffer sb, java.lang.String type, java.lang.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(java.lang.StringBuffer sb, java.lang.String type, java.lang.Integer prec, java.lang.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(java.sql.Connection connection, java.lang.String sql) throws java.sql.SQLException
connection
- The JDBC connection to use.sql
- The SQL update statement.
java.sql.SQLException
- Upon database errorsStatement.executeUpdate(String)
public static void copyResultField(java.sql.PreparedStatement ps, int pc, java.sql.ResultSet rs, int rc) throws java.sql.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.
java.sql.SQLException
public static void joinIdentifiers(java.lang.StringBuffer sb, java.util.Collection<java.lang.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 java.lang.String joinIdentifiers(java.util.Collection<java.lang.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 |