本文整理汇总了Java中java.sql.Connection.createClob方法的典型用法代码示例。如果您正苦于以下问题:Java Connection.createClob方法的具体用法?Java Connection.createClob怎么用?Java Connection.createClob使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类java.sql.Connection
的用法示例。
在下文中一共展示了Connection.createClob方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: testBug56122
import java.sql.Connection; //导入方法依赖的package包/类
/**
* Tests fix for Bug#56122 - JDBC4 functionality failure when using replication connections.
*/
public void testBug56122() throws Exception {
for (final Connection testConn : new Connection[] { this.conn, getFailoverConnection(), getLoadBalancedConnection(),
getMasterSlaveReplicationConnection() }) {
testConn.createClob();
testConn.createBlob();
testConn.createNClob();
testConn.createSQLXML();
testConn.isValid(12345);
testConn.setClientInfo(new Properties());
testConn.setClientInfo("NAME", "VALUE");
testConn.getClientInfo();
testConn.getClientInfo("CLIENT");
assertThrows(SQLFeatureNotSupportedException.class, new Callable<Void>() {
public Void call() throws Exception {
testConn.createArrayOf("A_TYPE", null);
return null;
}
});
assertThrows(SQLFeatureNotSupportedException.class, new Callable<Void>() {
public Void call() throws Exception {
testConn.createStruct("A_TYPE", null);
return null;
}
});
}
}
示例2: getLobLiteral
import java.sql.Connection; //导入方法依赖的package包/类
public static Literal getLobLiteral(Object inputValue, String dataType, Connection connection) throws SQLException{
Literal literal = null;
if(connection==null){
literal = new NullLiteral();
}else{
if(SqlColumnType.BLOB.equalsIgnoreCase(dataType)){
literal= new BlobLiteral();
Blob blob = connection.createBlob();
Binary objArray = (Binary) inputValue;
blob.setBytes(1, objArray.getData());
literal.setLiteralValue(blob);
}else if(SqlColumnType.CLOB.equalsIgnoreCase(dataType)){
literal = new ClobLiteral();
Clob clob = connection.createClob();
clob.setString(1, String.valueOf(inputValue));
literal.setLiteralValue(clob);
}
}
return literal;
}
示例3: executeOnConnection
import java.sql.Connection; //导入方法依赖的package包/类
@Override
public Clob executeOnConnection(Connection connection) throws SQLException {
return connection.createClob();
}
示例4: createClob
import java.sql.Connection; //导入方法依赖的package包/类
/**
* {@link java.sql.Connection#createClob()}のラッパー
*
* @param conn コネクション
* @return Clobインタフェースを実装しているオブジェクト
*
* @see java.sql.Connection#createClob()
*/
public static Clob createClob(final Connection conn) {
try {
return conn.createClob();
} catch (SQLException e) {
throw new UroborosqlRuntimeException(e);
}
}