Package java.sql

Examples of java.sql.SQLException.initCause()


import java.sql.SQLException;

public class _SQLException {
  public static SQLException createNewInstance(Throwable t){
    SQLException sql = new SQLException();
    sql.initCause(t);
    return sql;
  }
}
View Full Code Here


    public String getString() throws SQLException {
        try {
            return ObjectConverterUtil.convertToString(getCharacterStream());
        } catch (IOException e) {
      SQLException ex = new SQLException(e.getMessage());
      ex.initCause(e);
      throw ex;
        }
    }

    public OutputStream setBinaryStream() throws SQLException {
View Full Code Here

      try {
        this.streamFactory.free();
        this.streamFactory = null;
      } catch (IOException e) {
        SQLException ex = new SQLException(e.getMessage());
        ex.initCause(e);
        throw ex;
      }
    }
  }
 
View Full Code Here

      if (r != null) {
        return r;
      }
    } catch (IOException e) {
      SQLException ex = new SQLException(e.getMessage());
      ex.initCause(e);
      throw ex;
    }
    Charset cs = getCharset();
    if (cs == null) {
      cs = Streamable.CHARSET;
View Full Code Here

    public InputStream getBinaryStream() throws SQLException {
      try {
      return this.getStreamFactory().getInputStream();
    } catch (IOException e) {
      SQLException ex = new SQLException(e.getMessage());
      ex.initCause(e);
      throw ex;
    }
    }
   
    @Override
View Full Code Here

            message = "IO exception";
        } else {
            message = "General exception";
        }
        SQLException e2 = new SQLException(message + ": " + e.toString());
        e2.initCause(e);
        return e2;
    }

}
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

                    _supportsIsValidMethod = true; // assume it does; we'll lazily check the first time we try to connect
                } catch(Exception e) {
                    _dataSource = null;
                    log.error("AppServerJDBCXARecovery.createDataSource got exception during getXADataSource call: "+e.toString(), e);
                    SQLException sqlException = new SQLException(e.toString());
                    sqlException.initCause(e);
                    throw sqlException;
                }
            }
        }
        catch (MBeanException mbe)
View Full Code Here

            } else {
                log.error("AppServerJDBCXARecovery.createDataSource(name="+_dataSourceId+") got exception " + mbe.toString(), mbe);
            }

            SQLException sqlException = new SQLException(mbe.toString());
            sqlException.initCause(mbe);
            throw sqlException;
        }
        catch (SQLException ex)
        {
            log.error("AppServerJDBCXARecovery.createDataSource got exception "+ex.toString(), ex);
View Full Code Here

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

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

    /**
 
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.