public class SQLUtility
extends java.lang.Object
Constructor and Description |
---|
SQLUtility() |
Modifier and Type | Method and Description |
---|---|
static void |
doCall(java.sql.Connection con,
java.lang.String call)
Perform a call.
|
static void |
doSql(java.sql.Connection con,
java.util.List<java.lang.String> sqlList)
Execute SQL
|
static void |
doSql(java.sql.Connection con,
java.util.List<java.lang.String> sqlList,
boolean ignoreError)
Execute a number of lines of SQL, with option of suppressing an error thrown.
|
static void |
doSql(java.sql.Connection dc,
SQLSpecificTransform sqlTransform,
java.lang.String... sql)
Execute a group of SQL statements.
|
static int |
doSql(java.sql.Connection dc,
SQLSpecificTransform transform,
java.lang.String sql)
Transform the SQL and then perform it.
|
static int |
doSql(java.sql.Connection con,
java.lang.String sql)
Execute SQL
|
static int |
doSql(java.sql.Connection con,
java.lang.String sql,
boolean ignoreError)
Execute a single line of SQL, with option of suppressing an error thrown.
|
static boolean |
exists(java.sql.Connection dc,
java.lang.String query)
Returns if any rows were selected by the query.
|
static java.util.List<java.lang.String> |
listAllStrings(java.sql.Connection dc,
java.lang.String query)
Returns all strings for the first column value returned.
|
static java.util.List<AttributeStorage> |
selectAll(java.sql.Connection dc,
java.lang.String query,
AttributeStorageDefinition retStoreDef)
Select data from all rows.
|
static AttributeStorage |
selectFirst(java.sql.Connection con,
java.lang.String query,
AttributeStorageDefinition asd)
Get data for the first row only.
|
static java.lang.Boolean |
selectFirstBoolean(java.sql.Connection con,
java.lang.String query)
Select the value as a Boolean, using the Maximo YORN definition,
where 1 is true and 0 is false.
|
static java.lang.Double |
selectFirstDouble(java.sql.Connection con,
java.lang.String query)
Select the value as a Double.
|
static java.lang.Integer |
selectFirstInteger(java.sql.Connection con,
java.lang.String query)
Select the value as an Integer.
|
static java.lang.Long |
selectFirstLong(java.sql.Connection con,
java.lang.String query)
Select the value as a Long.
|
static java.lang.String |
selectFirstString(java.sql.Connection dc,
java.lang.String query)
Select the value as a string.
|
public static java.lang.String selectFirstString(java.sql.Connection dc, java.lang.String query) throws java.sql.SQLException
dc
- The connection to query.query
- The queryjava.sql.SQLException
public static java.util.List<java.lang.String> listAllStrings(java.sql.Connection dc, java.lang.String query) throws java.sql.SQLException
dc
- The connection to query.query
- The queryjava.sql.SQLException
public static int doSql(java.sql.Connection con, java.lang.String sql, boolean ignoreError) throws java.sql.SQLException
con
- The connection to use.sql
- The SQL statement to execute.ignoreError
- If true, any SQL exception will be caught and ignored.java.sql.SQLException
public static java.lang.Integer selectFirstInteger(java.sql.Connection con, java.lang.String query) throws java.sql.SQLException
dc
- The connection to query.query
- The queryjava.sql.SQLException
public static boolean exists(java.sql.Connection dc, java.lang.String query) throws java.sql.SQLException
dc
- The connectionquery
- The SQL queryjava.sql.SQLException
public static java.util.List<AttributeStorage> selectAll(java.sql.Connection dc, java.lang.String query, AttributeStorageDefinition retStoreDef) throws java.sql.SQLException
dc
- query
- retStoreDef
- java.sql.SQLException
public static void doSql(java.sql.Connection con, java.util.List<java.lang.String> sqlList, boolean ignoreError) throws java.lang.Exception
con
- The connection to use.sqlList
- The SQL statements to execute.ignoreError
- If true, any SQL exception will be caught and ignored.java.sql.SQLException
java.lang.Exception
public static void doSql(java.sql.Connection con, java.util.List<java.lang.String> sqlList) throws java.lang.Exception
con
- sqlList
- java.lang.Exception
public static int doSql(java.sql.Connection con, java.lang.String sql) throws java.sql.SQLException
con
- sqlList
- java.sql.SQLException
public static AttributeStorage selectFirst(java.sql.Connection con, java.lang.String query, AttributeStorageDefinition asd) throws java.sql.SQLException
con
- query
- asd
- java.sql.SQLException
public static java.lang.Boolean selectFirstBoolean(java.sql.Connection con, java.lang.String query) throws java.sql.SQLException
dc
- The connection to query.query
- The queryjava.sql.SQLException
public static int doSql(java.sql.Connection dc, SQLSpecificTransform transform, java.lang.String sql) throws java.sql.SQLException
dc
- sqlTransform
- string
- java.sql.SQLException
public static java.lang.Long selectFirstLong(java.sql.Connection con, java.lang.String query) throws java.sql.SQLException
con
- The connection to query.query
- The queryjava.sql.SQLException
public static void doSql(java.sql.Connection dc, SQLSpecificTransform sqlTransform, java.lang.String... sql) throws java.sql.SQLException
dc
- sqlTransform
- sql
- java.lang.Exception
java.sql.SQLException
public static void doCall(java.sql.Connection con, java.lang.String call) throws java.sql.SQLException
con
- Connectioncall
- Call statementjava.sql.SQLException
public static java.lang.Double selectFirstDouble(java.sql.Connection con, java.lang.String query) throws java.sql.SQLException
con
- The connection to query.query
- The queryjava.sql.SQLException