Package javax.sql.rowset.serial

Examples of javax.sql.rowset.serial.SerialBlob


      TeiidProcessingException, SerialException, IOException {
    CommandContext cc = new CommandContext();
    cc.setBufferManager(BufferManagerFactory.getStandaloneBufferManager());
    SQLXML xml = XMLSystemFunctions.jsonToXml(cc, rootName, new SerialClob(json.toCharArray()));
    assertEquals(expected, xml.getString());
    xml = XMLSystemFunctions.jsonToXml(cc, rootName, new SerialBlob(json.getBytes(Charset.forName("UTF-8"))));
    assertEquals(expected, xml.getString());
    xml = XMLSystemFunctions.jsonToXml(cc, rootName, new SerialBlob(json.getBytes(Charset.forName("UTF-32BE"))));
    assertEquals(expected, xml.getString());
  }
View Full Code Here


            PreparedStatement ps = connection.prepareStatement(
                "INSERT INTO blo(id, b) values(2, ?)");

            //st.executeUpdate("INSERT INTO blo (id, b) VALUES (1, x'A003')");
            ps.setBlob(1, new SerialBlob(baR1));
            ps.executeUpdate();

            rs = st.executeQuery("SELECT b FROM blo WHERE id = 2");

            if (!rs.next()) {
View Full Code Here

                    Debug.logWarning("Blob java-type used for java.lang.Object. Use java.lang.Object java-type instead.", module);
                    return blobObject;
                } else {
                    if (originalObject instanceof Blob) {
                        // NOTE using SerialBlob here instead of the Blob from the database to make sure we can pass it around, serialize it, etc
                        return new SerialBlob((Blob) originalObject);
                    } else {
                        Debug.logWarning("Blob java-type used for byte array. Use byte[] java-type instead.", module);
                        return originalObject;
                    }
                }
View Full Code Here

                        if (blobObject != null) {
                            entity.dangerousSetNoCheckButFast(curField, blobObject);
                        } else {
                            if (originalObject instanceof Blob) {
                                // NOTE using SerialBlob here instead of the Blob from the database to make sure we can pass it around, serialize it, etc
                                entity.dangerousSetNoCheckButFast(curField, new SerialBlob((Blob) originalObject));
                            } else {
                                entity.dangerousSetNoCheckButFast(curField, originalObject);
                            }
                        }
                    }
View Full Code Here

        while (true) {
            try {
                message.getBody();
                stmt = conn.prepareStatement("INSERT INTO " + getTableNameForTopic(topic) + " VALUES(?,?)");
                stmt.setLong(1, seqId);
                stmt.setBlob(2, new SerialBlob(message.toByteArray()));

                int rowCount = stmt.executeUpdate();
                stmt.close();
                if (rowCount != 1) {
                    logger.error("Unexpected number of affected rows from derby");
View Full Code Here

            throw new SQLException();
        }
        if (params == null) {
            throw new SQLException();
        }
        params.put(Integer.valueOf(parameterIndex - 1), new SerialBlob(x));
    }
View Full Code Here

public class SerialBlobFactory implements SerialLocatorFactory<Blob>
{
  @Override
  public Blob createSerial(Blob blob) throws SQLException
  {
    return new SerialBlob(blob);
  }
View Full Code Here

      int content = fis.read();
      while (content != -1) {
        baos.write(content);
        content = fis.read();
      }
      Blob blob = new SerialBlob(baos.toByteArray());
      byte[] actualBytes = (byte[]) JPAEntityParser.getBytes(blob);
      byte[] expectedBytes = baos.toByteArray();

      assertEquals(expectedBytes.length, actualBytes.length);
      int size = actualBytes.length;
View Full Code Here

public class OnJPAWriteContentMock implements OnJPAWriteContent {

  @Override
  public Blob getJPABlob(final byte[] binaryData) throws ODataJPARuntimeException {
    try {
      return new SerialBlob(binaryData);
    } catch (SerialException e) {
      ODataJPARuntimeException.throwException(ODataJPARuntimeException.INNER_EXCEPTION, e);
    } catch (SQLException e) {
      ODataJPARuntimeException.throwException(ODataJPARuntimeException.INNER_EXCEPTION, e);
    }
View Full Code Here

            PreparedStatement ps = connection.prepareStatement(
                "INSERT INTO blo(id, b) values(2, ?)");

            //st.executeUpdate("INSERT INTO blo (id, b) VALUES (1, x'A003')");
            ps.setBlob(1, new SerialBlob(baR1));
            ps.executeUpdate();

            rs = st.executeQuery("SELECT b FROM blo WHERE id = 2");

            if (!rs.next()) {
View Full Code Here

TOP

Related Classes of javax.sql.rowset.serial.SerialBlob

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.