Package java.sql

Examples of java.sql.SQLException.initCause()


                info = resultPacket.readString(this.connection.getErrorMessageEncoding(), getExceptionInterceptor());
            }
        } catch (Exception ex) {
            SQLException sqlEx = SQLError.createSQLException(SQLError.get(
                    SQLError.SQL_STATE_GENERAL_ERROR), SQLError.SQL_STATE_GENERAL_ERROR, -1, getExceptionInterceptor());
            sqlEx.initCause(ex);
           
            throw sqlEx;
        }

        ResultSetInternalMethods updateRs = com.mysql.jdbc.ResultSetImpl.getInstance(updateCount,
View Full Code Here


            SQLException sqlEx = SQLError.createSQLException(Messages.getString("MysqlIO.76") //$NON-NLS-1$
                 +this.socketFactoryClassName +
                Messages.getString("MysqlIO.77"),
                SQLError.SQL_STATE_UNABLE_TO_CONNECT_TO_DATASOURCE, getExceptionInterceptor());
           
            sqlEx.initCause(ex);
           
            throw sqlEx;
        }
    }
View Full Code Here

                try {
                    fileIn.close();
                } catch (Exception ex) {
                    SQLException sqlEx = SQLError.createSQLException(Messages.getString("MysqlIO.65"), //$NON-NLS-1$
                        SQLError.SQL_STATE_GENERAL_ERROR, getExceptionInterceptor());
                    sqlEx.initCause(ex);
                   
                    throw sqlEx;
                }

                fileIn = null;
View Full Code Here

  protected void setSocketTimeout(int milliseconds) throws SQLException {
    try {
      mysqlConnection.setSoTimeout(milliseconds);
    } catch (SocketException e) {
      SQLException sqlEx = SQLError.createSQLException("Invalid socket timeout value or state", SQLError.SQL_STATE_ILLEGAL_ARGUMENT, getExceptionInterceptor());
      sqlEx.initCause(e);
     
      throw sqlEx;
    }
  }
View Full Code Here

      }

      SQLException sqlEx = SQLError.createSQLException(mesg.toString(),
          SQLError.SQL_STATE_COMMUNICATION_LINK_FAILURE, getExceptionInterceptor());
     
      sqlEx.initCause(ex);
     
      throw sqlEx;
    }
   
    NonRegisteringDriver.trackConnection(this);
View Full Code Here

       
      } catch (SQLException ex) {
        throw ex;
      } catch (RuntimeException ex) {
        SQLException sqlEx = SQLError.createSQLException(ex.toString(), SQLError.SQL_STATE_ILLEGAL_ARGUMENT, null);
        sqlEx.initCause(ex);
        throw sqlEx;
      } finally {
        if (results != null) {
          try {
            results.close();
View Full Code Here

    SQLException ex = SQLError.createSQLException(messageBuf.toString(),
        SQLError.SQL_STATE_CONNECTION_NOT_OPEN, getExceptionInterceptor());
   
    if (this.forceClosedReason != null) {
      ex.initCause(this.forceClosedReason);
    }

    throw ex;
  }
View Full Code Here

              .toUpperCase(Locale.ENGLISH));
      } catch (SQLException ex) {
        throw ex;
      } catch (RuntimeException ex) {
        SQLException sqlEx = SQLError.createSQLException(ex.toString(), SQLError.SQL_STATE_ILLEGAL_ARGUMENT, null);
        sqlEx.initCause(ex);
        throw sqlEx;
      }
    }

    //
View Full Code Here

          setEncoding(getJavaEncodingForMysqlEncoding(oldEncoding));
        } catch (SQLException ex) {
          throw ex;
        } catch (RuntimeException ex) {
          SQLException sqlEx = SQLError.createSQLException(ex.toString(), SQLError.SQL_STATE_ILLEGAL_ARGUMENT, null);
          sqlEx.initCause(ex);
          throw sqlEx;
        }

        if (getEncoding() == null) {
          throw SQLError.createSQLException(
View Full Code Here

          }
        } catch (SQLException ex) {
          throw ex;
        } catch (RuntimeException ex) {
          SQLException sqlEx = SQLError.createSQLException(ex.toString(), SQLError.SQL_STATE_ILLEGAL_ARGUMENT, null);
          sqlEx.initCause(ex);
          throw sqlEx;
        }

        if (getEncoding() == null) {
          // punt?
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.