public abstract class Util
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
private static int |
logSeverityLevel |
Constructor and Description |
---|
Util() |
Modifier and Type | Method and Description |
---|---|
static void |
ASSERT(EmbedConnection conn,
boolean mustBeTrue,
java.lang.String msg)
Mimic SanityManager.ASSERT in a JDBC-friendly way,
and providing system cleanup for JDBC failures.
|
static void |
checkForSupportedDataType(int dataType)
Checks whether a data type is supported and raises a SQLException
if it isn't.
|
static void |
checkSupportedRaiseStandard(int dataType)
Checks whether a data type is supported and raises a StandardException
if it isn't.
|
static java.sql.SQLException |
generateCsSQLException(StandardException se) |
static java.sql.SQLException |
generateCsSQLException(java.lang.String error,
java.lang.Object... args) |
(package private) static java.sql.SQLException |
generateCsSQLException(java.lang.String error,
java.lang.Throwable t,
java.lang.Object... args) |
private static boolean |
isSupportedType(int dataType)
Returns false if a data type is not supported for:
setObject(int, Object, int) and
setObject(int, Object, int, int) . |
static java.sql.SQLException |
javaException(java.lang.Throwable t) |
static void |
logAndThrowSQLException(java.sql.SQLException se)
Log SQLException to the error log if the severity exceeds the
logSeverityLevel and then throw it.
|
private static void |
logError(java.lang.String errorMessage,
java.lang.Throwable t) |
static void |
logSQLException(java.sql.SQLException se)
Log an SQLException to the error log or to the console if there is no
error log available.
|
(package private) static java.io.IOException |
newIOException(java.lang.Throwable cause)
Create an
IOException that wraps another Throwable . |
static java.sql.SQLException |
noCurrentConnection() |
static java.sql.SQLException |
notImplemented() |
static java.sql.SQLException |
notImplemented(java.lang.String feature) |
static java.sql.SQLException |
policyNotReloaded(java.lang.Throwable t) |
(package private) static java.sql.SQLException |
seeNextException(java.lang.String messageId,
java.sql.SQLException next,
java.lang.Throwable cause,
java.lang.Object... args)
Generate an
SQLException which points to another
SQLException nested within it with
setNextException() . |
(package private) static java.sql.SQLException |
setStreamFailure(java.io.IOException e) |
static int[] |
squashLongs(long[] longs)
Squash an array of longs into an array of ints
|
(package private) static java.sql.SQLException |
typeMisMatch(int targetSQLType) |
static java.lang.String |
typeName(int jdbcType) |
public static void logAndThrowSQLException(java.sql.SQLException se) throws java.sql.SQLException
se
- SQLException to log and throwjava.sql.SQLException
public static void logSQLException(java.sql.SQLException se)
se
- SQLException to logprivate static void logError(java.lang.String errorMessage, java.lang.Throwable t)
public static void ASSERT(EmbedConnection conn, boolean mustBeTrue, java.lang.String msg) throws java.sql.SQLException
java.sql.SQLException
- the exceptionpublic static void checkForSupportedDataType(int dataType) throws java.sql.SQLException
java.sql.SQLException
public static void checkSupportedRaiseStandard(int dataType) throws StandardException
StandardException
private static boolean isSupportedType(int dataType)
setObject(int, Object, int)
and
setObject(int, Object, int, int)
.dataType
- the data type to checkpublic static java.sql.SQLException generateCsSQLException(java.lang.String error, java.lang.Object... args)
static java.sql.SQLException generateCsSQLException(java.lang.String error, java.lang.Throwable t, java.lang.Object... args)
public static java.sql.SQLException generateCsSQLException(StandardException se)
public static java.sql.SQLException noCurrentConnection()
static java.sql.SQLException seeNextException(java.lang.String messageId, java.sql.SQLException next, java.lang.Throwable cause, java.lang.Object... args)
SQLException
which points to another
SQLException
nested within it with
setNextException()
.messageId
- message idnext
- the next SQLException, possibly nullcause
- the underlying exception, possibly nullargs
- the arguments to the message creationpublic static java.sql.SQLException javaException(java.lang.Throwable t)
public static java.sql.SQLException policyNotReloaded(java.lang.Throwable t)
public static java.sql.SQLException notImplemented()
public static java.sql.SQLException notImplemented(java.lang.String feature)
static java.sql.SQLException setStreamFailure(java.io.IOException e)
static java.sql.SQLException typeMisMatch(int targetSQLType)
public static int[] squashLongs(long[] longs)
static java.io.IOException newIOException(java.lang.Throwable cause)
IOException
that wraps another Throwable
.cause
- the underlying cause of the errorIOException
linked to cause
public static java.lang.String typeName(int jdbcType)
Apache Derby V10.13 Internals - Copyright © 2004,2016 The Apache Software Foundation. All Rights Reserved.