Package java.sql

Examples of java.sql.SQLException.initCause()


            } catch (InterruptedException ex) {
                if (getPoolProperties().getPropagateInterruptState()) {
                    Thread.currentThread().interrupt();
                }
                SQLException sx = new SQLException("Pool wait interrupted.");
                sx.initCause(ex);
                throw sx;
            } finally {
                waitcount.decrementAndGet();
            }
            if (maxWait==0 && con == null) { //no wait, return one if we have one
View Full Code Here


                log.debug("Unable to create a new JDBC connection.", e);
            if (e instanceof SQLException) {
                throw (SQLException)e;
            } else {
                SQLException ex = new SQLException(e.getMessage());
                ex.initCause(e);
                throw ex;
            }
        } finally {
            // con can never be null here
            if (error ) {
View Full Code Here

                    setToNull = true;
                    if (x instanceof SQLException) {
                        throw (SQLException)x;
                    } else {
                        SQLException ex  = new SQLException(x.getMessage());
                        ex.initCause(x);
                        throw ex;
                    }
                }
            }
View Full Code Here

                setToNull = true;
                if (x instanceof SQLException) {
                    throw (SQLException)x;
                } else {
                    SQLException ex  = new SQLException(x.getMessage());
                    ex.initCause(x);
                    throw ex;
                }
            }
        } finally {
            con.unlock();
View Full Code Here

        } catch (java.lang.Exception cn) {
            if (log.isDebugEnabled()) {
                log.debug("Unable to instantiate JDBC driver.", cn);
            }
            SQLException ex = new SQLException(cn.getMessage());
            ex.initCause(cn);
            throw ex;
        }
        String driverURL = poolProperties.getUrl();
        String usr = null;
        String pwd = null;
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

            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

     * @param e the original exception
     * @return the converted SQL exception
     */
    protected static SQLException convertException(Exception e) {
        SQLException e2 = new SQLException("Error while indexing document", "FULLTEXT");
        e2.initCause(e);
        return e2;
    }

    /**
     * Create the trigger.
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

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.