Package java.sql

Examples of java.sql.SQLXML


                    }
                    else if (columnTypes[col-1] == Types.BLOB) {
                        sb.append(anObj != null ? "BLOB" : "null"); //$NON-NLS-1$ //$NON-NLS-2$
                    }
                    else if (columnTypes[col-1] == Types.SQLXML) {
                      SQLXML xml = (SQLXML)anObj;
                      sb.append(anObj != null ? prettyPrint(xml) : "null"); //$NON-NLS-1$
                    }
                    else {
                        sb.append(anObj != null ? anObj : "null"); //$NON-NLS-1$
                    }
View Full Code Here


        if (type == Types.BLOB) {
          Object anObj = results.getObject(col);
            sb.append(anObj != null ? "BLOB" : "null"); //$NON-NLS-1$ //$NON-NLS-2$
        }
        else if (type == Types.SQLXML) {
          SQLXML xml = results.getSQLXML(col);
          sb.append(xml != null ? ResultSetReader.prettyPrint(xml) : "null"); //$NON-NLS-1$
        }
        else {
          String str = results.getString(col);
            sb.append(str != null ? str : "null"); //$NON-NLS-1$
View Full Code Here

                        "<age>32</age>" + //$NON-NLS-1$
                     "</customer>"; //$NON-NLS-1$
       
       StringToSQLXMLTransform transform = new StringToSQLXMLTransform();
      
       SQLXML xmlValue = (SQLXML)transform.transformDirect(xml);
       assertEquals(xml.replaceAll("[\r]", ""), xmlValue.getString().replaceAll("[\r]", ""));
    }
View Full Code Here

          } catch (Throwable e) {
            // TODO Auto-generated catch block
            throw new SQLException(e);
          }
            } else if (object instanceof SQLXML){
              SQLXML s = (SQLXML)object;
            try {
              result = ObjectConverterUtil.convertToString(s.getBinaryStream());
         
        } catch (Throwable e) {
          // TODO Auto-generated catch block
          throw new SQLException(e);
        }
View Full Code Here

                } catch (Throwable e) {
                  // TODO Auto-generated catch block
                  throw new QueryTestFailedException(e);
                }
                    } else if (actualValue instanceof SQLXML){
                      SQLXML s = (SQLXML)actualValue;
                    try {
              actualValue = ObjectConverterUtil.convertToString(s.getBinaryStream());
             
            } catch (Throwable e) {
              // TODO Auto-generated catch block
              throw new QueryTestFailedException(e);
            }
View Full Code Here

  private void helpTestJson(String json, String rootName, String expected)
      throws SQLException, TeiidComponentException,
      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

   
    rs = s.executeQuery("show plan");
    assertTrue(rs.next());
    assertEquals(rs.getMetaData().getColumnType(1), Types.CLOB);
    assertTrue(rs.getString(1).startsWith("ProjectNode"));
    SQLXML plan = rs.getSQLXML(2);
    assertTrue(plan.getString().startsWith("<?xml"));
    assertNull(rs.getObject("DEBUG_LOG"));
    assertNotNull(rs.getObject("PLAN_TEXT"));
   
    s.execute("SET showplan debug");
    rs = s.executeQuery("select * from all_tables");
View Full Code Here

//#ifdef JAVA6
    public SQLXML getSQLXML(int columnIndex) throws SQLException {

        checkColumn(columnIndex);

        SQLXML sqlxml;
        int    type = resultMetaData.columnTypes[columnIndex - 1].typeCode;

        switch (type) {

            case Types.SQL_XML : {
View Full Code Here

          String text = extractClobText((Clob)databaseFieldValue, schemaFieldName);
          record.put(schemaFieldName, text);
        }
        else if (databaseFieldValue instanceof SQLXML)
        {
          SQLXML xmlInst = (SQLXML) databaseFieldValue;
          try
          {
            record.put(schemaFieldName,xmlInst.getString());
          }
          catch (SQLException e)
          {
            throw new EventCreationException("Cannot convert " + databaseFieldValue.getClass() +
                                             " to string field " + schemaFieldName + " cause: " + e);
View Full Code Here

//#ifdef JAVA6
    public SQLXML getSQLXML(int columnIndex) throws SQLException {

        checkColumn(columnIndex);

        SQLXML sqlxml;
        int    type = resultMetaData.columnTypes[columnIndex - 1].typeCode;

        switch (type) {

            case Types.SQL_XML : {
View Full Code Here

TOP

Related Classes of java.sql.SQLXML

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.