Package java.sql

Examples of java.sql.SQLException.initCause()


        try {
          return (T) getObject(columnIndex);
        } catch (ClassCastException cce) {
          SQLException sqlEx = SQLError.createSQLException("Conversion not supported for type " + type.getName(),
              SQLError.SQL_STATE_ILLEGAL_ARGUMENT, getExceptionInterceptor());
          sqlEx.initCause(cce);
         
          throw sqlEx;
        }
      }
     
View Full Code Here


              tz, rollForward);
        }
      } catch (RuntimeException ex) {
        SQLException sqlEx = SQLError.createSQLException(ex.toString(),
            SQLError.SQL_STATE_ILLEGAL_ARGUMENT, getExceptionInterceptor());
        sqlEx.initCause(ex);
       
        throw sqlEx;
      }
    }
  }
View Full Code Here

      }
    } catch (RuntimeException e) {
      SQLException sqlEx = SQLError.createSQLException("Cannot convert value '"
          + timestampValue + "' from column " + columnIndex
          + " to TIMESTAMP.", SQLError.SQL_STATE_ILLEGAL_ARGUMENT, getExceptionInterceptor());
      sqlEx.initCause(e);
     
      throw sqlEx;
    }
   
  }
View Full Code Here

      SQLException sqlEx = SQLError.createSQLException(
          Messages.getString("RowDataDynamic.8") //$NON-NLS-1$
              + exceptionType
              + Messages.getString("RowDataDynamic.9") + exceptionMessage, SQLError.SQL_STATE_GENERAL_ERROR, this.exceptionInterceptor); //$NON-NLS-1$
      sqlEx.initCause(ex);
     
      throw sqlEx;
    }
  }
View Full Code Here

    if (mysqlName != null) {
      try {
        javaName = CharsetMapping.MYSQL_TO_JAVA_CHARSET_MAP.get(mysqlName);
      } catch (RuntimeException ex) {
        SQLException sqlEx = SQLError.createSQLException(ex.toString(), SQLError.SQL_STATE_ILLEGAL_ARGUMENT, null);
        sqlEx.initCause(ex);
        throw sqlEx;
      }
    }

    return javaName;
View Full Code Here

        originalResultSet, connection,
        Integer.valueOf(warningCount), noIndexUsed ? Boolean.TRUE : Boolean.FALSE, noGoodIndexUsed ? Boolean.TRUE: Boolean.FALSE,
            statementException});
    } catch (IllegalArgumentException e) {
      SQLException sqlEx = new SQLException("Unable to reflectively invoke interceptor");
      sqlEx.initCause(e);
     
      throw sqlEx;
    } catch (IllegalAccessException e) {
      SQLException sqlEx = new SQLException("Unable to reflectively invoke interceptor");
      sqlEx.initCause(e);
View Full Code Here

      sqlEx.initCause(e);
     
      throw sqlEx;
    } catch (IllegalAccessException e) {
      SQLException sqlEx = new SQLException("Unable to reflectively invoke interceptor");
      sqlEx.initCause(e);
     
      throw sqlEx;
    } catch (InvocationTargetException e) {
      SQLException sqlEx = new SQLException("Unable to reflectively invoke interceptor");
      sqlEx.initCause(e);
View Full Code Here

      sqlEx.initCause(e);
     
      throw sqlEx;
    } catch (InvocationTargetException e) {
      SQLException sqlEx = new SQLException("Unable to reflectively invoke interceptor");
      sqlEx.initCause(e);
     
      throw sqlEx;
    }
  }
View Full Code Here

        SQLException sqlEx = SQLError
            .createSQLException(
                "Syntax error for TIMESTAMP escape sequence '"
                    + argument + "'",
                "42000", conn.getExceptionInterceptor());
        sqlEx.initCause(illegalArgumentException);

        throw sqlEx;
      }
    }
  }
View Full Code Here

        plugin = plugin.getClass().newInstance();
        plugin.init(this.connection, this.connection.getProperties());
      } catch (Throwable t) {
        SQLException sqlEx = SQLError.createSQLException(Messages
            .getString("Connection.BadAuthenticationPlugin", new Object[] { plugin.getClass().getName() }), getExceptionInterceptor());
        sqlEx.initCause(t);
        throw sqlEx;
      }
    }
   
    return plugin;
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.