Java Code Examples for java.sql.SQLXML

The following examples show how to use java.sql.SQLXML. These examples are extracted from open source projects. 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   Source 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   Source 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   Source 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   Source 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
@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   Source 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   Source 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   Source 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   Source 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
@Override
public SQLXML getSQLXML(int columnIndex) throws SQLException {
    throw new UnsupportedOperationException("Not supported yet.");
}
 
Example 11
Source Project: fabric-jdbc-connector   Source File: FabricConnection.java    License: Apache License 2.0 4 votes vote down vote up
public SQLXML createSQLXML() throws SQLException {
    throw new UnsupportedOperationException();
}
 
Example 12
@Override
public SQLXML getSQLXML(String columnLabel) throws SQLException {
    throw new UnsupportedOperationException("Not supported yet.");
}
 
Example 13
Source Project: tddl5   Source 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   Source 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
@Override
public void updateSQLXML(int columnIndex, SQLXML xmlObject) throws SQLException {
    throw new UnsupportedOperationException("Not supported yet.");
}
 
Example 16
Source Project: waltz   Source 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   Source 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
@Override
public void setSQLXML(String parameterName, SQLXML xmlObject) throws SQLException {
    throw new UnsupportedOperationException("Not supported yet.");
}
 
Example 19
Source Project: HTTP-RPC   Source 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   Source 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
@Override
public void updateSQLXML( int arg0, SQLXML arg1 ) throws SQLException {
throw new SQLException( "updates not supported" );
}
 
Example 22
Source Project: jdk8u60   Source 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   Source 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   Source 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   Source 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   Source 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   Source 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
@Override
public SQLXML getSQLXML(int columnIndex) throws SQLException {
    throw new UnsupportedOperationException("Not supported yet.");
}
 
Example 29
Source Project: snowflake-jdbc   Source 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
@Override
public SQLXML getSQLXML(String columnLabel) throws SQLException {
    throw new UnsupportedOperationException("Not supported yet.");
}