org.apache.derby.impl.jdbc
Class EmbedSQLWarning

java.lang.Object
  extended byjava.lang.Throwable
      extended byjava.lang.Exception
          extended byjava.sql.SQLException
              extended byjava.sql.SQLWarning
                  extended byorg.apache.derby.impl.jdbc.EmbedSQLWarning
All Implemented Interfaces:
java.io.Serializable

public class EmbedSQLWarning
extends java.sql.SQLWarning

This class understands the message protocol and looks up SQLExceptions based on keys, so that the Local JDBC driver's messages can be localized. REMIND: May want to investigate putting some of this in the protocol side, for the errors that any Cloudscape JDBC driver might return. The ASSERT mechanism is a wrapper of the basic services, to ensure that failed asserts at this level will behave well in a JDBC environment.

Author:
ames
See Also:
Serialized Form

Field Summary
 
Fields inherited from class java.sql.SQLException
 
Fields inherited from class java.lang.Exception
 
Fields inherited from class java.lang.Throwable
 
Constructor Summary
protected EmbedSQLWarning(java.lang.String message, java.lang.String sqlstate)
          Because SQLWarning does not have settable fields, the caller of the constructor must do message lookup, and pass the appropriate values here for message and SQLState,
 
Method Summary
static java.sql.SQLWarning generateCsSQLWarning(StandardException se)
          Generate an SQL Warning from a Standard Exception
static java.sql.SQLWarning newEmbedSQLWarning(java.lang.String messageId)
           
static java.sql.SQLWarning newEmbedSQLWarning(java.lang.String messageId, java.lang.Object arg)
          This looks up the message and sqlstate values and generates the appropriate exception off of them.
 java.lang.String toString()
          Override Throwable's toString() to avoid the class name appearing in the message.
 
Methods inherited from class java.sql.SQLWarning
getNextWarning, setNextWarning
 
Methods inherited from class java.sql.SQLException
getErrorCode, getNextException, getSQLState, setNextException
 
Methods inherited from class java.lang.Throwable
fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

EmbedSQLWarning

protected EmbedSQLWarning(java.lang.String message,
                          java.lang.String sqlstate)
Because SQLWarning does not have settable fields, the caller of the constructor must do message lookup, and pass the appropriate values here for message and SQLState,

Method Detail

toString

public java.lang.String toString()
Override Throwable's toString() to avoid the class name appearing in the message.


newEmbedSQLWarning

public static java.sql.SQLWarning newEmbedSQLWarning(java.lang.String messageId)

newEmbedSQLWarning

public static java.sql.SQLWarning newEmbedSQLWarning(java.lang.String messageId,
                                                     java.lang.Object arg)
This looks up the message and sqlstate values and generates the appropriate exception off of them.


generateCsSQLWarning

public static java.sql.SQLWarning generateCsSQLWarning(StandardException se)
Generate an SQL Warning from a Standard Exception

Parameters:
se - Exception to convert to a warning
Returns:
new SQLWarning with message and SQLState of the se

Built on Tue 2006-10-10 19:23:47+0200, from revision exported

Apache Derby V10.1 Engine Documentation - Copyright © 1997,2005 The Apache Software Foundation or its licensors, as applicable.