當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。