本文整理汇总了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());
}
};
}
示例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;
}
示例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
}
示例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());
}
}
示例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);
}
}
示例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;
}
示例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);
}
}
示例8: getSQLXML
import java.sql.SQLXML; //导入依赖的package包/类
@Override
public SQLXML getSQLXML(String columnLabel) throws SQLException {
throw new UnsupportedOperationException("Not supported yet.");
}
示例9: getSQLXML
import java.sql.SQLXML; //导入依赖的package包/类
public SQLXML getSQLXML(String columnLabel) throws SQLException {
return getSQLXML(findColumn(columnLabel));
}
示例10: updateSQLXML
import java.sql.SQLXML; //导入依赖的package包/类
@Override
default void updateSQLXML(String columnLabel, SQLXML xmlObject) throws SQLException {
}
示例11: updateSQLXML
import java.sql.SQLXML; //导入依赖的package包/类
@Override
public void updateSQLXML(String columnLabel, SQLXML xmlObject) throws SQLException
{
throw new SQLFeatureNotSupportedException();
}
示例12: setSQLXML
import java.sql.SQLXML; //导入依赖的package包/类
@Override
public void setSQLXML(int parameterIndex, SQLXML xmlObject) throws SQLException
{
parameters.setParameter(parameterIndex, xmlObject);
}
示例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);
}
}
示例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 );
}
示例15: createSQLXML
import java.sql.SQLXML; //导入依赖的package包/类
public SQLXML createSQLXML() throws SQLException {
return this.getJDBC4Connection().createSQLXML();
}