Package java.sql

Examples of java.sql.SQLException.initCause()


    try {
      return i.read(b);
    } catch (Throwable ex) {
      SQLException sqlEx = SQLError.createSQLException(Messages.getString("PreparedStatement.56") //$NON-NLS-1$
          + ex.getClass().getName(), SQLError.SQL_STATE_GENERAL_ERROR, getExceptionInterceptor());
      sqlEx.initCause(ex);
     
      throw sqlEx;
    }
  }
View Full Code Here


      return i.read(b, 0, lengthToRead);
    } catch (Throwable ex) {
      SQLException sqlEx = SQLError.createSQLException(Messages.getString("PreparedStatement.56") //$NON-NLS-1$
          + ex.getClass().getName(), SQLError.SQL_STATE_GENERAL_ERROR, getExceptionInterceptor());
      sqlEx.initCause(ex);
     
      throw sqlEx;
    }
  }
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;
        }
 
        // escape them
        int numBytes = x.length;
View Full Code Here

                  + Messages.getString("PreparedStatement.18") //$NON-NLS-1$
                  + ex.getClass().getName()
                  + Messages.getString("PreparedStatement.19") + ex.getMessage(), //$NON-NLS-1$
              SQLError.SQL_STATE_GENERAL_ERROR, getExceptionInterceptor());
         
          sqlEx.initCause(ex);
         
          throw sqlEx;
        }
      }
    }
View Full Code Here

      this.parameterTypes[parameterIndex - 1 + getParameterIndexOffset()] = Types.BINARY;
    } catch (Exception ex) {
      SQLException sqlEx = SQLError.createSQLException(Messages.getString("PreparedStatement.54") //$NON-NLS-1$
          + ex.getClass().getName(),
          SQLError.SQL_STATE_ILLEGAL_ARGUMENT, getExceptionInterceptor());
      sqlEx.initCause(ex);
     
      throw sqlEx;
    }
  }
View Full Code Here

                  && !this.connection.parserKnowsUnicode())) {
            hexEscape = true;
          }
        } catch (RuntimeException ex) {
          SQLException sqlEx = SQLError.createSQLException(ex.toString(), SQLError.SQL_STATE_ILLEGAL_ARGUMENT, null);
          sqlEx.initCause(ex);
          throw sqlEx;
        }
 
        if (streamLength == -1) {
          useLength = false;
View Full Code Here

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

    SingleByteCharsetConverter converter = new SingleByteCharsetConverter(
        javaEncodingName);
View Full Code Here

          .getString("NonRegisteringDriver.17") //$NON-NLS-1$
          + ex.toString()
          + Messages.getString("NonRegisteringDriver.18"), //$NON-NLS-1$
          SQLError.SQL_STATE_UNABLE_TO_CONNECT_TO_DATASOURCE, null);
     
      sqlEx.initCause(ex);
     
      throw sqlEx;
    }
  }
View Full Code Here

              "Unable to load configuration template '"
                  + configName
                  + "' due to underlying IOException: "
                  + ioEx,
              SQLError.SQL_STATE_INVALID_CONNECTION_ATTRIBUTE, null);
          sqlEx.initCause(ioEx);
         
          throw sqlEx;
        }
      }
View Full Code Here

      SQLException sqlEx = SQLError.createSQLException(Messages.getString(
          "ResultSet.Bad_format_for_Date", new Object[] { stringVal,
              Integer.valueOf(columnIndex) }),
          SQLError.SQL_STATE_ILLEGAL_ARGUMENT, getExceptionInterceptor()); //$NON-NLS-1$
     
      sqlEx.initCause(e);
     
      throw sqlEx;
    }
  }
 
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.