Package java.sql

Examples of java.sql.SQLException$InternalIterator


              ex = null;
            }
          }
        }
        if (ex != null) {
          SQLException se = null;
          if (e.getCause() instanceof SQLException) {
            se = (SQLException)e.getCause();
          } else {
            se = TeiidSQLException.create(e.getCause());
          }
View Full Code Here


       */
      StringBuilder sb = new StringBuilder(columnName.length() + 4);
      databaseType.appendEscapedEntityName(sb, columnName);
      index = cursor.getColumnIndex(sb.toString());
      if (index < 0) {
        throw new SQLException("Unknown field '" + columnName + "' from the Android sqlite cursor");
      }
    }
    return index;
  }
View Full Code Here

    if (string == null || string.length() == 0) {
      return 0;
    } else if (string.length() == 1) {
      return string.charAt(0);
    } else {
      throw new SQLException("More than 1 character stored in database column: " + columnIndex);
    }
  }
View Full Code Here

  public double getDouble(int columnIndex) throws SQLException {
    return cursor.getDouble(columnIndex);
  }

  public Timestamp getTimestamp(int columnIndex) throws SQLException {
    throw new SQLException("Android does not support timestamp.  Use JAVA_DATE_LONG or JAVA_DATE_STRING types");
  }
View Full Code Here

            if (child == null){
                if (exception instanceof ConfigurationException) {
                    ConfigurationException e = (ConfigurationException) exception;
                    child = e.getRootCause();
                } else if (exception instanceof SQLException) {
                    SQLException e = (SQLException) exception;
                    child = e.getNextException();
                }
                if (child == null) {
                  child = exception.getCause();
                }
                if (child == exception) {
View Full Code Here

      this.metadata = metadata;
    }
   
    public Object getValue(int columnIndex, Integer metadataPropertyKey) throws SQLException {
        if(columnIndex < 0 || columnIndex >= metadata.length) {
            throw new SQLException(JDBCPlugin.Util.getString("StaticMetadataProvider.Invalid_column", columnIndex)); //$NON-NLS-1$
        }
       
        Map column = this.metadata[columnIndex];
        return column.get(metadataPropertyKey);
    }
View Full Code Here

    } else if (sourceClass == StAXSource.class) {
      XMLInputFactory factory = XMLInputFactory.newInstance();
      try {
        return (T) new StAXSource(factory.createXMLStreamReader(getBinaryStream()));
      } catch (XMLStreamException e) {
        throw new SQLException(e);
      }
    } else if (sourceClass == SAXSource.class) {
      return (T) new SAXSource(new InputSource(getBinaryStream()));
    } else if (sourceClass == DOMSource.class) {
      try {
        DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
        dbf.setNamespaceAware(true);
        DocumentBuilder docBuilder = dbf.newDocumentBuilder();
              Node doc = docBuilder.parse(new InputSource(getBinaryStream()));
              return (T) new DOMSource(doc);
      } catch (ParserConfigurationException e) {
        throw new SQLException(e);
      } catch (SAXException e) {
        throw new SQLException(e);
      } catch (IOException e) {
        throw new SQLException(e);
      }
    }
        throw new SQLException("Unsupported source type " + sourceClass); //$NON-NLS-1$
    }
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;
        }
    }
View Full Code Here

     * <code>BLOB</code>
     */
    public byte[] getBytes(long pos, int length) throws SQLException {
        if (pos < 1) {
            Object[] params = new Object[] {new Long(pos)};
            throw new SQLException(CorePlugin.Util.getString("MMClob_MMBlob.0", params)); //$NON-NLS-1$
        }
        else if (pos > length()) {
            return null;
        }
        pos = pos - 1;
       
        if (length < 0) {
            Object[] params = new Object[] {new Integer( length)};
            throw new SQLException(CorePlugin.Util.getString("MMClob_MMBlob.3", params)); //$NON-NLS-1$
        }
        else if (pos + length > length()) {
            length = (int)(length() - pos);
        }
        InputStream in = getBinaryStream();
        try {
          long skipped = 0;
          while (pos > 0) {
            skipped = in.skip(pos);
            pos -= skipped;
          }
          return ObjectConverterUtil.convertToByteArray(in, length);
        } catch (IOException e) {
          throw new SQLException(e);
        } finally {
          try {
        in.close();
      } catch (IOException e) {
      }
View Full Code Here

          while (is.read() != -1) {
            length++;
          }
        getStreamFactory().setLength(length);
      } catch (IOException e) {
        throw new SQLException(e);
      } finally {
        try {
          is.close();
        } catch (IOException e) {
        }
View Full Code Here

TOP

Related Classes of java.sql.SQLException$InternalIterator

Copyright © 2018 www.massapicom. 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.