Examples of Blob


Examples of java.sql.Blob

      {
        key = (ResourceKey) value;
      }
      else if (value instanceof Blob)
      {
        final Blob b = (Blob) value;
        final byte[] data = IOUtils.getInstance().readBlob(b);
        key = resManager.createKey(data);
      }
      else if (value instanceof String)
      {
View Full Code Here

Examples of java.sql.Blob

    {
      return new ByteArrayInputStream((byte[]) o);
    }
    if (o instanceof Blob)
    {
      final Blob b = (Blob) o;
      try
      {
        return b.getBinaryStream();
      }
      catch (SQLException e)
      {
        throw new IOException("Failed to convert from BLOB");
      }
View Full Code Here

Examples of java.sql.Blob

      {
        key = (ResourceKey) value;
      }
      else if (value instanceof Blob)
      {
        final Blob b = (Blob) value;
        final byte[] data = IOUtils.getInstance().readBlob(b);
        key = resManager.createKey(data);
      }
      else if (value instanceof String)
      {
View Full Code Here

Examples of java.sql.Blob

            throw new Exception("An exception occured when processing '" + name + "'", ex);
         }
      }
      if (val instanceof Blob) { // only for relatively small clobs (< 10MB)
         try {
            Blob blob = (Blob)val;
            InputStream in = blob.getBinaryStream();
            ByteArrayOutputStream baos = new ByteArrayOutputStream();
            // StringBuffer strBuf = new StringBuffer();
            byte[] buf = new byte[100000];
            int read = 0;
            int count=0;
View Full Code Here

Examples of java.sql.Blob

      DebugFile.incIdent();
    }

    JDCConnection oConn = null;
    PreparedStatement oStmt = null;
    Blob oContentTxt;
    ByteArrayOutputStream byOutPart;
    int iPrevPart = 0, iThisPart = 0, iNextPart = 0, iPartStart = 0;

    try {
      MimeMultipart oParts = (MimeMultipart) oMsg.getContent();
View Full Code Here

Examples of java.sql.Blob

    return "DataBaseAvatarBase";
  }

  protected byte[] getBytes(String name) {
    SqlRowSet rowSet = jdbcTemplate.queryForRowSet(sql, name);
    Blob obj = null;
    if (rowSet.next()) {
      obj = (Blob) rowSet.getObject(1);
      try {
        return obj.getBytes(1L, (int) obj.length());
      } catch (SQLException e) {
        e.printStackTrace();
        return null;
      }
    } else {
View Full Code Here

Examples of java.sql.Blob

    // We always get the BLOB, even when we are not reading the contents.
    // Since the BLOB is just a pointer to the BLOB data rather than the
    // data itself, this operation should not take much time (as opposed
    // to getting all of the data in the blob).
    Blob blob = rs.getBlob(index);

    if (rs.wasNull())
      return null;

    // BLOB exists, so try to read the data from it
    // based on the user's directions
    if (_readBlobs)
    {
      // User said to read at least some of the data from the blob
      byte[] blobData = null;
      if (blob != null)
      {
        int len = (int)blob.length();
        if (len > 0)
        {
          int charsToRead = len;
          if (! _readCompleteBlobs)
          {
            charsToRead = _readBlobsSize;
          }
          if (charsToRead > len)
          {
            charsToRead = len;
          }
          blobData = blob.getBytes(1, charsToRead);
        }
      }

      // determine whether we read all there was in the blob or not
      boolean wholeBlobRead = false;
View Full Code Here

Examples of java.sql.Blob

            }

            int colType = rs.getMetaData().getColumnType(1);
            switch(colType) {
                case Types.BLOB :
                    Blob blob = rs.getBlob(1);
                    if (blob != null) {
                        return new JDBCInputStream(blob.getBinaryStream(), conn);
                    }
                    break;

                case Types.CLOB :
                    Clob clob = rs.getClob(1);
View Full Code Here

Examples of java.sql.Blob

    params.put("objectid", objectid);

    ResultSet resultSet = transaction.query(query, params);

    if (resultSet.next()) {
        Blob data = resultSet.getBlob("data");
      int protocolVersion = NetConst.FIRST_VERSION_WITH_MULTI_VERSION_SUPPORT - 1;
      Object temp = resultSet.getObject("protocol_version");
      if (temp != null) {
        protocolVersion = ((Integer) temp).intValue();
      }
View Full Code Here

Examples of java.sql.Blob

      RPObject player = null;
      while (result.next()) {
        int objectid = result.getInt("object_id");
        String name = result.getString("charname");
        Blob data = result.getBlob("data");
        int protocolVersion = NetConst.FIRST_VERSION_WITH_MULTI_VERSION_SUPPORT - 1;
        Object temp = result.getObject("protocol_version");
        if (temp != null) {
          protocolVersion = ((Integer) temp).intValue();
        }
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.