当前位置: 首页>>代码示例>>Java>>正文


Java SQLXML类代码示例

本文整理汇总了Java中java.sql.SQLXML的典型用法代码示例。如果您正苦于以下问题:Java SQLXML类的具体用法?Java SQLXML怎么用?Java SQLXML使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


SQLXML类属于java.sql包,在下文中一共展示了SQLXML类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: newSqlXmlValue

import java.sql.SQLXML; //导入依赖的package包/类
@Override
public SqlXmlValue newSqlXmlValue(final XmlCharacterStreamProvider provider) {
	return new AbstractJdbc4SqlXmlValue() {
		@Override
		protected void provideXml(SQLXML xmlObject) throws SQLException, IOException {
			provider.provideXml(xmlObject.setCharacterStream());
		}
	};
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:10,代码来源:Jdbc4SqlXmlHandler.java

示例2: getSQLXML

import java.sql.SQLXML; //导入依赖的package包/类
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;

}
 
开发者ID:JuanJoseFJ,项目名称:ProyectoPacientes,代码行数:15,代码来源:JDBC4CallableStatementWrapper.java

示例3: createSQLXML

import java.sql.SQLXML; //导入依赖的package包/类
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
}
 
开发者ID:rafallis,项目名称:BibliotecaPS,代码行数:12,代码来源:JDBC4ConnectionWrapper.java

示例4: setSQLXML

import java.sql.SQLXML; //导入依赖的package包/类
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());
    }
}
 
开发者ID:JuanJoseFJ,项目名称:ProyectoPacientes,代码行数:9,代码来源:JDBC4PreparedStatementHelper.java

示例5: setSQLXML

import java.sql.SQLXML; //导入依赖的package包/类
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);
    }
}
 
开发者ID:bragex,项目名称:the-vigilantes,代码行数:12,代码来源:JDBC4CallableStatementWrapper.java

示例6: getSQLXML

import java.sql.SQLXML; //导入依赖的package包/类
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;
}
 
开发者ID:bragex,项目名称:the-vigilantes,代码行数:14,代码来源:JDBC4CallableStatementWrapper.java

示例7: setSQLXML

import java.sql.SQLXML; //导入依赖的package包/类
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);
    }
}
 
开发者ID:JuanJoseFJ,项目名称:ProyectoPacientes,代码行数:12,代码来源:JDBC4CallableStatementWrapper.java

示例8: getSQLXML

import java.sql.SQLXML; //导入依赖的package包/类
@Override
public SQLXML getSQLXML(String columnLabel) throws SQLException {
    throw new UnsupportedOperationException("Not supported yet.");
}
 
开发者ID:lambdalab-mirror,项目名称:jdk8u-jdk,代码行数:5,代码来源:StubJdbcRowSetImpl.java

示例9: getSQLXML

import java.sql.SQLXML; //导入依赖的package包/类
public SQLXML getSQLXML(String columnLabel) throws SQLException {
    return getSQLXML(findColumn(columnLabel));
}
 
开发者ID:rafallis,项目名称:BibliotecaPS,代码行数:4,代码来源:JDBC4UpdatableResultSet.java

示例10: updateSQLXML

import java.sql.SQLXML; //导入依赖的package包/类
@Override
default void updateSQLXML(String columnLabel, SQLXML xmlObject) throws SQLException {
}
 
开发者ID:agroal,项目名称:agroal,代码行数:4,代码来源:MockResultSet.java

示例11: updateSQLXML

import java.sql.SQLXML; //导入依赖的package包/类
@Override
public void updateSQLXML(String columnLabel, SQLXML xmlObject) throws SQLException
{
	throw new SQLFeatureNotSupportedException();
}
 
开发者ID:olavloite,项目名称:spanner-jdbc,代码行数:6,代码来源:AbstractCloudSpannerResultSet.java

示例12: setSQLXML

import java.sql.SQLXML; //导入依赖的package包/类
@Override
public void setSQLXML(int parameterIndex, SQLXML xmlObject) throws SQLException
{
	parameters.setParameter(parameterIndex, xmlObject);
}
 
开发者ID:olavloite,项目名称:spanner-jdbc,代码行数:6,代码来源:AbstractCloudSpannerPreparedStatement.java

示例13: validateShard

import java.sql.SQLXML; //导入依赖的package包/类
/**
 * 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);
    }
}
 
开发者ID:Microsoft,项目名称:elastic-db-tools-for-java,代码行数:66,代码来源:ValidationUtils.java

示例14: testClosedResultSet_updateSQLXML2_throws

import java.sql.SQLXML; //导入依赖的package包/类
@Test( expected = AlreadyClosedSqlException.class )
public void testClosedResultSet_updateSQLXML2_throws() throws SQLException {
  closedResultSet.updateSQLXML( "columnLabel", (SQLXML) null );
}
 
开发者ID:skhalifa,项目名称:QDrill,代码行数:5,代码来源:Drill2489CallsAfterCloseThrowExceptionsTest.java

示例15: createSQLXML

import java.sql.SQLXML; //导入依赖的package包/类
public SQLXML createSQLXML() throws SQLException {
    return this.getJDBC4Connection().createSQLXML();
}
 
开发者ID:rafallis,项目名称:BibliotecaPS,代码行数:4,代码来源:JDBC4MultiHostMySQLConnection.java


注:本文中的java.sql.SQLXML类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。