java.sql.SQLXML Java Examples

The following examples show how to use java.sql.SQLXML. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source Project: calcite   Author: apache   File: CalciteRemoteDriverTest.java    License: Apache License 2.0 6 votes vote down vote up
/** Check that the "get" conversion table looks like Table B-5 in JDBC 4.1
 * specification */
@Test void testTableB6() {
  SqlType[] columns = {
      SqlType.TINYINT, SqlType.SMALLINT, SqlType.INTEGER, SqlType.BIGINT,
      SqlType.REAL, SqlType.FLOAT, SqlType.DOUBLE, SqlType.DECIMAL,
      SqlType.NUMERIC, SqlType.BIT, SqlType.BOOLEAN, SqlType.CHAR,
      SqlType.VARCHAR, SqlType.LONGVARCHAR, SqlType.BINARY, SqlType.VARBINARY,
      SqlType.LONGVARBINARY, SqlType.DATE, SqlType.TIME, SqlType.TIMESTAMP,
      SqlType.CLOB, SqlType.BLOB, SqlType.ARRAY, SqlType.REF,
      SqlType.DATALINK, SqlType.STRUCT, SqlType.JAVA_OBJECT, SqlType.ROWID,
      SqlType.NCHAR, SqlType.NVARCHAR, SqlType.LONGNVARCHAR, SqlType.NCLOB,
      SqlType.SQLXML
  };
  final PrintWriter out =
      CalciteSystemProperty.DEBUG.value()
          ? Util.printWriter(System.out)
          : new PrintWriter(new StringWriter());
  for (SqlType.Method row : SqlType.Method.values()) {
    out.print(pad(row.methodName));
    for (SqlType column : columns) {
      out.print(SqlType.canGet(row, column) ? "x " : ". ");
    }
    out.println();
  }
}
 
Example #2
Source Project: lams   Author: lamsfoundation   File: Jdbc4SqlXmlHandler.java    License: GNU General Public License v2.0 5 votes vote down vote up
@Override
public Source getXmlAsSource(ResultSet rs, String columnName, Class<? extends Source> sourceClass) throws SQLException {
	SQLXML xmlObject = rs.getSQLXML(columnName);
	if (xmlObject == null) {
		return null;
	}
	return (sourceClass != null ? xmlObject.getSource(sourceClass) : xmlObject.getSource(DOMSource.class));
}
 
Example #3
Source Project: cactoos-jdbc   Author: fabriciofx   File: PreparedStatementEnvelope.java    License: MIT License 5 votes vote down vote up
@Override
public void setSQLXML(
    final int parameterIndex,
    final SQLXML xmlObject
) throws SQLException {
    this.origin.setSQLXML(parameterIndex, xmlObject);
}
 
Example #4
Source Project: teiid-spring-boot   Author: teiid   File: TeiidRSProvider.java    License: Apache License 2.0 5 votes vote down vote up
private InputStream handleResult(String charSet, Object result) {
    if (result == null) {
        return null; // or should this be an empty result?
    }
    try {
        if (result instanceof SQLXML) {
            if (charSet != null) {
                XMLSerialize serialize = new XMLSerialize();
                serialize.setTypeString("blob"); //$NON-NLS-1$
                serialize.setDeclaration(true);
                serialize.setEncoding(charSet);
                serialize.setDocument(true);
                return ((BlobType) XMLSystemFunctions.serialize(serialize, new XMLType((SQLXML) result)))
                        .getBinaryStream();
            }
            return ((SQLXML) result).getBinaryStream();
        } else if (result instanceof Blob) {
            return ((Blob) result).getBinaryStream();
        } else if (result instanceof Clob) {
            return new ReaderInputStream(((Clob) result).getCharacterStream(),
                    charSet == null ? Charset.defaultCharset() : Charset.forName(charSet));
        }
        return new ByteArrayInputStream(
                result.toString().getBytes(charSet == null ? Charset.defaultCharset() : Charset.forName(charSet)));
    } catch (SQLException | TransformationException e) {
        throw new ResponseStatusException(HttpStatus.INTERNAL_SERVER_ERROR, e.getMessage(), e);
    }
}
 
Example #5
Source Project: sharding-jdbc-1.5.1   Author: tianheframe   File: AbstractMemoryResultSetMerger.java    License: Apache License 2.0 5 votes vote down vote up
@Override
public Object getValue(final String columnLabel, final Class<?> type) throws SQLException {
    if (Blob.class == type || Clob.class == type || Reader.class == type || InputStream.class == type || SQLXML.class == type) {
        throw new SQLFeatureNotSupportedException();
    }
    return currentResultSetRow.getCell(labelAndIndexMap.get(columnLabel));
}
 
Example #6
Source Project: gemfirexd-oss   Author: gemxd   File: LogicalConnection40.java    License: Apache License 2.0 5 votes vote down vote up
public SQLXML createSQLXML()
      throws SQLException {
      try
      {
  		checkForNullPhysicalConnection();
          return physicalConnection_.createSQLXML();
} catch (SQLException sqle) {
	notifyException(sqle);
	throw sqle;
}
  }
 
Example #7
Source Project: spring-analysis-note   Author: Vip-Augus   File: Jdbc4SqlXmlHandler.java    License: MIT License 5 votes vote down vote up
@Override
@Nullable
public Source getXmlAsSource(ResultSet rs, int columnIndex, @Nullable Class<? extends Source> sourceClass)
		throws SQLException {

	SQLXML xmlObject = rs.getSQLXML(columnIndex);
	if (xmlObject == null) {
		return null;
	}
	return (sourceClass != null ? xmlObject.getSource(sourceClass) : xmlObject.getSource(DOMSource.class));
}
 
Example #8
Source Project: tddl   Author: cpsing   File: TPreparedStatement.java    License: Apache License 2.0 4 votes vote down vote up
@Override
public void setSQLXML(int parameterIndex, SQLXML xmlObject) throws SQLException {
    throw new SQLException("not support exception");
}
 
Example #9
Source Project: tddl5   Author: loye168   File: TResultSetWrapper.java    License: Apache License 2.0 4 votes vote down vote up
public SQLXML getSQLXML(String columnLabel) throws SQLException {
    return this.targetResultSet.getSQLXML(columnLabel);
}
 
Example #10
Source Project: TencentKona-8   Author: Tencent   File: StubJdbcRowSetImpl.java    License: GNU General Public License v2.0 4 votes vote down vote up
@Override
public SQLXML getSQLXML(int columnIndex) throws SQLException {
    throw new UnsupportedOperationException("Not supported yet.");
}
 
Example #11
Source Project: fabric-jdbc-connector   Author: Impetus   File: FabricConnection.java    License: Apache License 2.0 4 votes vote down vote up
public SQLXML createSQLXML() throws SQLException {
    throw new UnsupportedOperationException();
}
 
Example #12
Source Project: openjdk-jdk9   Author: AdoptOpenJDK   File: StubWebRowSetImpl.java    License: GNU General Public License v2.0 4 votes vote down vote up
@Override
public SQLXML getSQLXML(String columnLabel) throws SQLException {
    throw new UnsupportedOperationException("Not supported yet.");
}
 
Example #13
Source Project: tddl5   Author: loye168   File: CallableStatementWrapper.java    License: Apache License 2.0 4 votes vote down vote up
@Override
public SQLXML getSQLXML(String parameterName) throws SQLException {
    return ((CallableStatement) targetStatement).getSQLXML(parameterName);
}
 
Example #14
Source Project: doma   Author: domaframework   File: MockCallableStatement.java    License: Apache License 2.0 4 votes vote down vote up
@Override
public SQLXML getSQLXML(int parameterIndex) throws SQLException {
  notYetImplemented();
  return null;
}
 
Example #15
Source Project: dragonwell8_jdk   Author: alibaba   File: StubSyncResolver.java    License: GNU General Public License v2.0 4 votes vote down vote up
@Override
public void updateSQLXML(int columnIndex, SQLXML xmlObject) throws SQLException {
    throw new UnsupportedOperationException("Not supported yet.");
}
 
Example #16
Source Project: waltz   Author: wepay   File: AbstractClientCallbacksForJDBC.java    License: Apache License 2.0 4 votes vote down vote up
@Override
public SQLXML createSQLXML() throws SQLException {
    return connection.createSQLXML();
}
 
Example #17
Source Project: calcite-avatica   Author: apache   File: AvaticaResultSet.java    License: Apache License 2.0 4 votes vote down vote up
public void updateSQLXML(
    int columnIndex, SQLXML xmlObject) throws SQLException {
  throw AvaticaConnection.HELPER.unsupported();
}
 
Example #18
Source Project: openjdk-jdk8u   Author: AdoptOpenJDK   File: StubSyncResolver.java    License: GNU General Public License v2.0 4 votes vote down vote up
@Override
public void setSQLXML(String parameterName, SQLXML xmlObject) throws SQLException {
    throw new UnsupportedOperationException("Not supported yet.");
}
 
Example #19
Source Project: HTTP-RPC   Author: gk-brown   File: TestResultSet.java    License: Apache License 2.0 4 votes vote down vote up
@Override
public void updateSQLXML(String columnLabel, SQLXML xmlObject) {
    throw new UnsupportedOperationException();
}
 
Example #20
Source Project: jdk8u-jdk   Author: lambdalab-mirror   File: StubJoinRowSetImpl.java    License: GNU General Public License v2.0 4 votes vote down vote up
@Override
public void updateSQLXML(String columnLabel, SQLXML xmlObject) throws SQLException {
    throw new UnsupportedOperationException("Not supported yet.");
}
 
Example #21
Source Project: openbd-core   Author: OpenBD   File: cfQueryResultData.java    License: GNU General Public License v3.0 4 votes vote down vote up
@Override
public void updateSQLXML( int arg0, SQLXML arg1 ) throws SQLException {
throw new SQLException( "updates not supported" );
}
 
Example #22
Source Project: jdk8u60   Author: chenghanpeng   File: StubJdbcRowSetImpl.java    License: GNU General Public License v2.0 4 votes vote down vote up
@Override
public void setSQLXML(String parameterName, SQLXML xmlObject) throws SQLException {
    throw new UnsupportedOperationException("Not supported yet.");
}
 
Example #23
Source Project: Zebra   Author: Meituan-Dianping   File: ShardResultSet.java    License: Apache License 2.0 4 votes vote down vote up
@Override
public SQLXML getSQLXML(int columnIndex) throws SQLException {
	checkClosed();
	return super.getSQLXML(columnIndex);
}
 
Example #24
Source Project: XPagesExtensionLibrary   Author: OpenNTF   File: JdbcPoolConnection.java    License: Apache License 2.0 4 votes vote down vote up
public void setSQLXML(int parameterIndex, SQLXML xmlObject)
        throws SQLException {
    st.setSQLXML(parameterIndex, xmlObject);
}
 
Example #25
Source Project: gemfirexd-oss   Author: gemxd   File: EmbedConnection.java    License: Apache License 2.0 4 votes vote down vote up
public SQLXML createSQLXML() throws SQLException {
  throw new AssertionError("should be overridden in JDBC 4.0");
}
 
Example #26
Source Project: hottub   Author: dsrg-uoft   File: StubCachedRowSetImpl.java    License: GNU General Public License v2.0 4 votes vote down vote up
@Override
public SQLXML getSQLXML(int columnIndex) throws SQLException {
    throw new UnsupportedOperationException("Not supported yet.");
}
 
Example #27
Source Project: effectivejava   Author: ftomassetti   File: Jdbc4SqlXmlHandler.java    License: Apache License 2.0 4 votes vote down vote up
@Override
public Source getXmlAsSource(ResultSet rs, String columnName, Class<? extends Source> sourceClass) throws SQLException {
	SQLXML xmlObject = rs.getSQLXML(columnName);
	return (sourceClass != null ? xmlObject.getSource(sourceClass) : xmlObject.getSource(DOMSource.class));
}
 
Example #28
Source Project: openjdk-jdk8u   Author: AdoptOpenJDK   File: StubFilteredRowSetImpl.java    License: GNU General Public License v2.0 4 votes vote down vote up
@Override
public SQLXML getSQLXML(int columnIndex) throws SQLException {
    throw new UnsupportedOperationException("Not supported yet.");
}
 
Example #29
Source Project: snowflake-jdbc   Author: snowflakedb   File: SnowflakeResultSetV1.java    License: Apache License 2.0 4 votes vote down vote up
@Override
public void updateSQLXML(int columnIndex, SQLXML xmlObject) throws SQLException
{
  raiseSQLExceptionIfResultSetIsClosed();

}
 
Example #30
Source Project: openjdk-jdk9   Author: AdoptOpenJDK   File: StubJdbcRowSetImpl.java    License: GNU General Public License v2.0 4 votes vote down vote up
@Override
public SQLXML getSQLXML(String columnLabel) throws SQLException {
    throw new UnsupportedOperationException("Not supported yet.");
}