org.apache.openjpa.jdbc.sql
Class SQLExceptions

java.lang.Object
  extended by org.apache.openjpa.jdbc.sql.SQLExceptions

public class SQLExceptions
extends Object

Helper class for converting a SQLException into the appropriate OpenJPA type.

Author:
Marc Prud'hommeaux

Constructor Summary
SQLExceptions()
           
 
Method Summary
static OpenJPAException getStore(Localizer.Message msg, SQLException se, DBDictionary dict)
          Convert the specified exception into a StoreException.
static OpenJPAException getStore(SQLException se)
          Convert the specified exception into a StoreException.
static OpenJPAException getStore(SQLException se, DBDictionary dict)
          Convert the specified exception into a StoreException.
static OpenJPAException getStore(SQLException se, Object failed)
          Convert the specified exception into a OpenJPAException.
static OpenJPAException getStore(SQLException se, Object failed, DBDictionary dict)
          Convert the specified exception into a StoreException.
static OpenJPAException getStore(String msg, SQLException se, DBDictionary dict)
          Convert the specified exception into a StoreException.
static OpenJPAException getStore(String msg, SQLException se, Object failed, DBDictionary dict)
          Convert the specified exception into a StoreException.
static OpenJPAException narrow(String msg, SQLException se, DBDictionary dict)
          Narrows the given SQLException to a specific type of StoreException by analyzing the SQLState code supplied by SQLException.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SQLExceptions

public SQLExceptions()
Method Detail

getStore

public static OpenJPAException getStore(SQLException se)
Convert the specified exception into a StoreException.


getStore

public static OpenJPAException getStore(SQLException se,
                                        Object failed)
Convert the specified exception into a OpenJPAException.


getStore

public static OpenJPAException getStore(SQLException se,
                                        DBDictionary dict)
Convert the specified exception into a StoreException.


getStore

public static OpenJPAException getStore(SQLException se,
                                        Object failed,
                                        DBDictionary dict)
Convert the specified exception into a StoreException.


getStore

public static OpenJPAException getStore(Localizer.Message msg,
                                        SQLException se,
                                        DBDictionary dict)
Convert the specified exception into a StoreException.


getStore

public static OpenJPAException getStore(String msg,
                                        SQLException se,
                                        DBDictionary dict)
Convert the specified exception into a StoreException.


getStore

public static OpenJPAException getStore(String msg,
                                        SQLException se,
                                        Object failed,
                                        DBDictionary dict)
Convert the specified exception into a StoreException.


narrow

public static OpenJPAException narrow(String msg,
                                      SQLException se,
                                      DBDictionary dict)
Narrows the given SQLException to a specific type of StoreException by analyzing the SQLState code supplied by SQLException. Each database-specific dictionary can supply a set of error codes that will map to a specific specific type of StoreException via getSQLStates() method. The default behavior is to return generic StoreException.



Copyright © 2006-2008 Apache Software Foundation. All Rights Reserved.