Package java.sql

Examples of java.sql.SQLException.initCause()


        catch (Exception e)
        {
            log.error("AppServerJDBCXARecovery.createConnection got exception "+e.toString(), e);

            SQLException sqlException = new SQLException(e.toString());
            sqlException.initCause(e);
            throw sqlException;
        }
    }

    private class LocalConnectionEventListener implements ConnectionEventListener
View Full Code Here


            result = mv.get();
         }
         catch (Exception e)
         {
            SQLException sqe = new SQLException("Unable to extract MarshalledValue");
            sqe.initCause(e);
            throw sqe;
         }
      }
      return result;
   }
View Full Code Here

            value = mv.get();
         }
         catch (Exception e)
         {
            SQLException sqe = new SQLException("Unable to extract MarshalledValue");
            sqe.initCause(e);
            throw sqe;
         }
      }

      switch( jdbcType )
View Full Code Here

      SQLException batch =
      new java.sql.BatchUpdateException(sqle.getMessage(), sqle.getSQLState(),
                  sqle.getErrorCode(), successfulUpdateCount);

      batch.setNextException(sqle);
      batch.initCause(sqle);
      throw batch;
      }
  }

  /**
 
View Full Code Here

                       
        // When we have support for JDBC 4 SQLException subclasses, this is
        // where we decide which exception to create
        SQLException sqle = exceptionFactory.getSQLException(getMessage(), getSQLState(),
            getErrorCode());
        sqle.initCause(this);

        // Set up the nextException chain
        if ( nextException_ != null )
        {
            // The exception chain gets constructed automatically through
View Full Code Here

            }
            if (x instanceof SQLException) {
                throw (SQLException)x;
            } else {
                SQLException ex = new SQLException(x.getMessage());
                ex.initCause(x);
                throw ex;
            }
        }
        if (connection==null) {
            throw new SQLException("Driver:"+driver+" returned null for URL:"+driverURL);
View Full Code Here

                return (Driver) bundleContext.getBundle()
                        .loadClass(poolProperties.getDriverClassName()).newInstance();
        } catch (java.lang.Exception cn) {
            log.debug("Unable to instantiate JDBC driver.", cn);
            SQLException ex = new SQLException(cn.getMessage());
            ex.initCause(cn);
            throw ex;
        }
    }

    private Driver findMatchingDriver(Collection<Driver> drivers) {
View Full Code Here

        // If we're in a runtime that supports chained exceptions, set the cause
        // of the SQLException to be this SqlException.  Otherwise the stack
        // trace is lost.
         if (JVMInfo.JDK_ID >= JVMInfo.J2SE_14 )
        {
            sqle.initCause(this);
        }

        // Set up the nextException chain
        if ( nextException_ != null )
        {
View Full Code Here

            if (serverOutput != null) {
                serverOutput.close();
            }
        } catch(Exception e) {
            SQLException se = new SQLException("Error shutting down server");
            se.initCause(e);
        }
    }

   /**
     * starts the Networs server for this configuration.
View Full Code Here

            if (!started) {
                 throw failException;
            }
        } catch (Exception e) {
            SQLException se = new SQLException("Error starting network  server");
            se.initCause(failException);
            throw se;
      }
    }
    /**
     * Set the verbosity, i.e., whether debug statements print.
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.