本文整理匯總了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);
}
}