com.wm.app.b2b.server
Class DBException

java.lang.Object
  extended by com.wm.app.b2b.server.ServerException
      extended by com.wm.app.b2b.server.DBException

public class DBException
extends com.wm.app.b2b.server.ServerException

This class is returned by DBConnection and its subclasses when a database operation fails.

See Also:
DBConnection, JDBCConnection

Constructor Summary
DBException(java.sql.SQLException e)
          Constructs a DBException with the specified SQLException.
DBException(java.lang.String msg)
          Constructs a DBException with the specified message.
 
Method Summary
 int getErrorCode()
          Returns the SQLException error code from this DBException.
 java.lang.String getSQLState()
          Returns the SQLException state from this DBException.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DBException

public DBException(java.lang.String msg)
Constructs a DBException with the specified message.

Parameters:
msg - A String specifying the detailed error message for this DBException.

DBException

public DBException(java.sql.SQLException e)
Constructs a DBException with the specified SQLException.

Parameters:
e - The SQLException that is to be captured by this DBException.
Method Detail

getSQLState

public java.lang.String getSQLState()
Returns the SQLException state from this DBException. (This value is undefined if DBException was constructed using public DBException(String msg).)

Returns:
A String describing the SQLException when DBException was thrown.

getErrorCode

public int getErrorCode()
Returns the SQLException error code from this DBException. (This value is undefined if DBException was constructed using DBException(String msg).)

Returns:
An int representing the SQLException error code from this DBException object.