Java 类java.sql.SQLXML 实例源码

项目:lams    文件:Jdbc4SqlXmlHandler.java   
@Override
public SqlXmlValue newSqlXmlValue(final XmlCharacterStreamProvider provider) {
    return new AbstractJdbc4SqlXmlValue() {
        @Override
        protected void provideXml(SQLXML xmlObject) throws SQLException, IOException {
            provider.provideXml(xmlObject.setCharacterStream());
        }
    };
}
项目:ProyectoPacientes    文件:JDBC4CallableStatementWrapper.java   
public SQLXML getSQLXML(int parameterIndex) throws SQLException {
    try {
        if (this.wrappedStmt != null) {
            return ((CallableStatement) this.wrappedStmt).getSQLXML(parameterIndex);
        } else {
            throw SQLError.createSQLException("No operations allowed after statement closed", SQLError.SQL_STATE_GENERAL_ERROR, this.exceptionInterceptor);
        }
    } catch (SQLException sqlEx) {
        checkAndFireConnectionError(sqlEx);
    }

    return null;

}
项目:BibliotecaPS    文件:JDBC4ConnectionWrapper.java   
public SQLXML createSQLXML() throws SQLException {
    checkClosed();

    try {
        return ((java.sql.Connection) this.mc).createSQLXML();
    } catch (SQLException sqlException) {
        checkAndFireConnectionError(sqlException);
    }

    return null; // never reached, but compiler can't tell
}
项目:ProyectoPacientes    文件:JDBC4PreparedStatementHelper.java   
static void setSQLXML(PreparedStatement pstmt, int parameterIndex, SQLXML xmlObject) throws SQLException {
    if (xmlObject == null) {
        pstmt.setNull(parameterIndex, Types.SQLXML);
    } else {
        // FIXME: Won't work for Non-MYSQL SQLXMLs
        pstmt.setCharacterStream(parameterIndex, ((JDBC4MysqlSQLXML) xmlObject).serializeAsCharacterStream());
    }
}
项目:lams    文件:Jdbc4SqlXmlHandler.java   
@Override
public SqlXmlValue newSqlXmlValue(final Document document) {
    return new AbstractJdbc4SqlXmlValue() {
        @Override
        protected void provideXml(SQLXML xmlObject) throws SQLException, IOException {
            xmlObject.setResult(DOMResult.class).setNode(document);
        }
    };
}
项目:the-vigilantes    文件:JDBC4CallableStatementWrapper.java   
public void setSQLXML(int parameterIndex, SQLXML xmlObject) throws SQLException {
    try {
        if (this.wrappedStmt != null) {
            ((PreparedStatement) this.wrappedStmt).setSQLXML(parameterIndex, xmlObject);
        } else {
            throw SQLError.createSQLException("No operations allowed after statement closed", SQLError.SQL_STATE_GENERAL_ERROR, this.exceptionInterceptor);
        }
    } catch (SQLException sqlEx) {
        checkAndFireConnectionError(sqlEx);
    }
}
项目:the-vigilantes    文件:JDBC4CallableStatementWrapper.java   
public void setSQLXML(String parameterName, SQLXML xmlObject) throws SQLException {
    try {
        if (this.wrappedStmt != null) {
            ((CallableStatement) this.wrappedStmt).setSQLXML(parameterName, xmlObject);
        } else {
            throw SQLError.createSQLException("No operations allowed after statement closed", SQLError.SQL_STATE_GENERAL_ERROR, this.exceptionInterceptor);
        }
    } catch (SQLException sqlEx) {
        checkAndFireConnectionError(sqlEx);
    }
}
项目:the-vigilantes    文件:JDBC4CallableStatementWrapper.java   
public SQLXML getSQLXML(String parameterName) throws SQLException {
    try {
        if (this.wrappedStmt != null) {
            return ((CallableStatement) this.wrappedStmt).getSQLXML(parameterName);
        } else {
            throw SQLError.createSQLException("No operations allowed after statement closed", SQLError.SQL_STATE_GENERAL_ERROR, this.exceptionInterceptor);
        }
    } catch (SQLException sqlEx) {
        checkAndFireConnectionError(sqlEx);
    }

    return null;
}
项目:ProyectoPacientes    文件:JDBC4CallableStatementWrapper.java   
public void setSQLXML(String parameterName, SQLXML xmlObject) throws SQLException {
    try {
        if (this.wrappedStmt != null) {
            ((CallableStatement) this.wrappedStmt).setSQLXML(parameterName, xmlObject);
        } else {
            throw SQLError.createSQLException("No operations allowed after statement closed", SQLError.SQL_STATE_GENERAL_ERROR, this.exceptionInterceptor);
        }
    } catch (SQLException sqlEx) {
        checkAndFireConnectionError(sqlEx);
    }
}
项目:BibliotecaPS    文件:JDBC4CallableStatementWrapper.java   
public void setSQLXML(String parameterName, SQLXML xmlObject) throws SQLException {
    try {
        if (this.wrappedStmt != null) {
            ((CallableStatement) this.wrappedStmt).setSQLXML(parameterName, xmlObject);
        } else {
            throw SQLError.createSQLException("No operations allowed after statement closed", SQLError.SQL_STATE_GENERAL_ERROR, this.exceptionInterceptor);
        }
    } catch (SQLException sqlEx) {
        checkAndFireConnectionError(sqlEx);
    }
}
项目:jdk8u-jdk    文件:StubJdbcRowSetImpl.java   
@Override
public SQLXML getSQLXML(String columnLabel) throws SQLException {
    throw new UnsupportedOperationException("Not supported yet.");
}
项目:BibliotecaPS    文件:JDBC4UpdatableResultSet.java   
public SQLXML getSQLXML(String columnLabel) throws SQLException {
    return getSQLXML(findColumn(columnLabel));
}
项目:agroal    文件:MockResultSet.java   
@Override
default void updateSQLXML(String columnLabel, SQLXML xmlObject) throws SQLException {
}
项目:spanner-jdbc    文件:AbstractCloudSpannerResultSet.java   
@Override
public void updateSQLXML(String columnLabel, SQLXML xmlObject) throws SQLException
{
    throw new SQLFeatureNotSupportedException();
}
项目:spanner-jdbc    文件:AbstractCloudSpannerPreparedStatement.java   
@Override
public void setSQLXML(int parameterIndex, SQLXML xmlObject) throws SQLException
{
    parameters.setParameter(parameterIndex, xmlObject);
}
项目:elastic-db-tools-for-java    文件:ValidationUtils.java   
/**
 * Performs validation that the local representation is as up-to-date as the representation on the backing data store.
 *
 * @param conn
 *            Connection used for validation.
 * @param shardMapManager
 *            ShardMapManager reference.
 * @param shardMap
 *            Shard map for the shard.
 * @param shard
 *            Shard to validate.
 */
public static void validateShard(Connection conn,
        ShardMapManager shardMapManager,
        StoreShardMap shardMap,
        StoreShard shard) {
    Stopwatch stopwatch = Stopwatch.createStarted();

    StoreResults lsmResult = new StoreResults();

    JAXBElement jaxbElement = StoreOperationRequestBuilder.validateShardLocal(shardMap.getId(), shard.getId(), shard.getVersion());

    try (CallableStatement cstmt = conn.prepareCall(String.format("{call %s(?,?)}", StoreOperationRequestBuilder.SP_VALIDATE_SHARD_LOCAL))) {
        SQLXML sqlxml = conn.createSQLXML();

        JAXBContext context = JAXBContext.newInstance(StoreOperationInput.class, StoreShard.class, StoreShardMap.class);
        // Set the result value from SAX events.
        SAXResult sxResult = sqlxml.setResult(SAXResult.class);
        context.createMarshaller().marshal(jaxbElement, sxResult);
        /*
         * log.info("Xml:{}\n{}", "ValidateShardLocal", SqlStoreTransactionScope.asString(context, jaxbElement));//
         */

        cstmt.setSQLXML("input", sqlxml);
        cstmt.registerOutParameter("result", Types.INTEGER);
        Boolean hasResults = cstmt.execute();
        StoreResults storeResults = SqlResults.newInstance(cstmt);
        // After iterating resultSet's, get result integer.
        int result = cstmt.getInt("result");
        lsmResult.setResult(StoreResult.forValue(result));

        stopwatch.stop();

        log.info("Shard ValidateShard", "Complete; Shard: {}; Connection: {}; Result: {}; Duration: {}", shard.getLocation(),
                conn.getMetaData().getURL(), lsmResult.getResult(), stopwatch.elapsed(TimeUnit.MILLISECONDS));
    }
    catch (SQLException | JAXBException e) {
        e.printStackTrace();
    }

    if (lsmResult.getResult() != StoreResult.Success) {
        if (lsmResult.getResult() == StoreResult.ShardMapDoesNotExist) {
            shardMapManager.getCache().deleteShardMap(shardMap);
        }

        // Possible errors are:
        // StoreResult.ShardMapDoesNotExist
        // StoreResult.ShardDoesNotExist
        // StoreResult.ShardVersionMismatch
        // StoreResult.StoreVersionMismatch
        // StoreResult.MissingParametersForStoredProcedure
        throw StoreOperationErrorHandler.onValidationErrorLocal(lsmResult, shardMap, shard.getLocation(), "ValidateShard",
                StoreOperationRequestBuilder.SP_VALIDATE_SHARD_LOCAL);
    }
}
项目:QDrill    文件:Drill2489CallsAfterCloseThrowExceptionsTest.java   
@Test( expected = AlreadyClosedSqlException.class )
public void testClosedResultSet_updateSQLXML2_throws() throws SQLException {
  closedResultSet.updateSQLXML( "columnLabel", (SQLXML) null );
}
项目:BibliotecaPS    文件:JDBC4MultiHostMySQLConnection.java   
public SQLXML createSQLXML() throws SQLException {
    return this.getJDBC4Connection().createSQLXML();
}
项目:incubator-netbeans    文件:SQLStatement.java   
void setSQLXML(int parameterIndex, SQLXML xmlObject) {
    parameters.ensureCapacity(parameterIndex+1);
}
项目:jdk8u-jdk    文件:StubCachedRowSetImpl.java   
@Override
public void updateSQLXML(String columnLabel, SQLXML xmlObject) throws SQLException {
    throw new UnsupportedOperationException("Not supported yet.");
}
项目:openjdk-jdk10    文件:StubCallableStatement.java   
@Override
public void setSQLXML(String parameterName, SQLXML xmlObject) throws SQLException {
    throw new UnsupportedOperationException("Not supported yet.");
}
项目:lams    文件:JDBC4MultiHostMySQLConnection.java   
public SQLXML createSQLXML() throws SQLException {
    return this.getJDBC4Connection().createSQLXML();
}
项目:BibliotecaPS    文件:JDBC4ResultSet.java   
public SQLXML getSQLXML(int columnIndex) throws SQLException {
    checkColumnBounds(columnIndex);

    return new JDBC4MysqlSQLXML(this, columnIndex, getExceptionInterceptor());
}
项目:Saturn    文件:SyncRS.java   
@Override
public void updateSQLXML(String columnLabel, SQLXML xmlObject) throws SQLException {
    // TODO Auto-generated method stub
    throw new UnsupportedOperationException();
}
项目:agroal    文件:ResultSetWrapper.java   
@Override
public void updateSQLXML(int columnIndex, SQLXML xmlObject) throws SQLException {
    wrappedResultSet.updateSQLXML( columnIndex, xmlObject );
}
项目:BibliotecaPS    文件:JDBC4Connection.java   
public SQLXML createSQLXML() throws SQLException {
    return new JDBC4MysqlSQLXML(getExceptionInterceptor());
}
项目:sstore-soft    文件:JDBC4ResultSet.java   
@Override
public void updateSQLXML(int columnIndex, SQLXML xmlObject)
        throws SQLException {
    throw SQLError.noSupport();
}
项目:sstore-soft    文件:JDBC4CallableStatement.java   
@Override
public SQLXML getSQLXML(int parameterIndex) throws SQLException
{
    checkClosed();
    throw SQLError.noSupport();
}
项目:openjdk-jdk10    文件:StubCallableStatement.java   
@Override
public SQLXML getSQLXML(String parameterName) throws SQLException {
    throw new UnsupportedOperationException("Not supported yet.");
}
项目:sstore-soft    文件:JDBC4CallableStatement.java   
@Override
public void setSQLXML(String parameterName, SQLXML xmlObject) throws SQLException
{
    checkClosed();
    throw SQLError.noSupport();
}
项目:openjdk-jdk10    文件:StubJoinRowSetImpl.java   
@Override
public void updateSQLXML(int columnIndex, SQLXML xmlObject) throws SQLException {
    throw new UnsupportedOperationException("Not supported yet.");
}
项目:jdk8u-jdk    文件:StubJdbcRowSetImpl.java   
@Override
public SQLXML getSQLXML(int columnIndex) throws SQLException {
    throw new UnsupportedOperationException("Not supported yet.");
}
项目:QDrill    文件:Drill2489CallsAfterCloseThrowExceptionsTest.java   
@Test( expected = AlreadyClosedSqlException.class )
public void testClosedResultSet_updateSQLXML1_throws() throws SQLException {
  closedResultSet.updateSQLXML( 123, (SQLXML) null );
}
项目:ProyectoPacientes    文件:JDBC4UpdatableResultSet.java   
public SQLXML getSQLXML(int columnIndex) throws SQLException {
    return new JDBC4MysqlSQLXML(this, columnIndex, getExceptionInterceptor());
}
项目:blanco-sfdc-jdbc-driver    文件:BlancoGenericJdbcResultSet.java   
public SQLXML getSQLXML(String columnLabel) throws SQLException {
    return cacheResultSet.getSQLXML(columnLabel);
}
项目:jdk8u-jdk    文件:StubJoinRowSetImpl.java   
@Override
public void setSQLXML(String parameterName, SQLXML xmlObject) throws SQLException {
    throw new UnsupportedOperationException("Not supported yet.");
}
项目:nh-micro    文件:MicroPooledConnection.java   
@Override
public SQLXML createSQLXML() throws SQLException {
    return conn.createSQLXML();
}
项目:lams    文件:Jdbc4SqlXmlHandler.java   
@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));
}
项目:dremio-oss    文件:SqlAccessorWrapper.java   
@Override
public SQLXML getSQLXML() throws SQLException {
  throw new SQLFeatureNotSupportedException();
}
项目:jdk8u-jdk    文件:StubSyncResolver.java   
@Override
public SQLXML getSQLXML(int columnIndex) throws SQLException {
    throw new UnsupportedOperationException("Not supported yet.");
}