本文整理了Java中java.sql.Clob.setString()
方法的一些代码示例,展示了Clob.setString()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Clob.setString()
方法的具体详情如下:
包路径:java.sql.Clob
类名称:Clob
方法名:setString
[英]Writes a given Java String to this Clob object at a specified position.
[中]将给定的Java字符串写入此Clob对象的指定位置。
代码示例来源:origin: stackoverflow.com
try {
java.sql.Clob clob =
oracle.sql.CLOB.createTemporary(
connection, false, oracle.sql.CLOB.DURATION_SESSION);
clob.setString(1, xml);
stmt.setClob(position, clob);
stmt.execute();
}
// Important!
finally {
clob.free();
}
代码示例来源:origin: alibaba/druid
@Override
public void setClobAsString(PreparedStatement ps, int paramIndex, String content) throws SQLException {
Clob clob = ps.getConnection().createClob();
clob.setString(1, content);
ps.setClob(paramIndex, clob);
}
代码示例来源:origin: spring-projects/spring-framework
@Override
public void setClobAsString(PreparedStatement ps, int paramIndex, @Nullable String content)
throws SQLException {
if (content != null) {
Clob clob = ps.getConnection().createClob();
clob.setString(1, content);
this.temporaryClobs.add(clob);
ps.setClob(paramIndex, clob);
}
else {
ps.setClob(paramIndex, (Clob) null);
}
if (logger.isDebugEnabled()) {
logger.debug(content != null ? "Copied string into temporary CLOB with length " + content.length() :
"Set CLOB to null");
}
}
代码示例来源:origin: hibernate/hibernate-orm
@Override
public Clob createClob(String string) {
try {
final Clob clob = createClob();
clob.setString( 1, string );
return clob;
}
catch ( SQLException e ) {
throw new JDBCException( "Unable to set CLOB string after creation", e );
}
}
代码示例来源:origin: alibaba/druid
@Override
public int clob_setString(ClobProxy clob, long pos, String str, int offset, int len) throws SQLException {
if (this.pos < filterSize) {
return nextFilter().clob_setString(this, clob, pos, str, offset, len);
}
return clob.getRawClob().setString(pos, str, offset, len);
}
代码示例来源:origin: alibaba/druid
@Override
public int clob_setString(ClobProxy clob, long pos, String str) throws SQLException {
if (this.pos < filterSize) {
return nextFilter().clob_setString(this, clob, pos, str);
}
return clob.getRawClob().setString(pos, str);
}
代码示例来源:origin: com.alibaba/druid
@Override
public void setClobAsString(PreparedStatement ps, int paramIndex, String content) throws SQLException {
Clob clob = ps.getConnection().createClob();
clob.setString(1, content);
ps.setClob(paramIndex, clob);
}
代码示例来源:origin: com.alibaba/druid
@Override
public int clob_setString(ClobProxy clob, long pos, String str, int offset, int len) throws SQLException {
if (this.pos < filterSize) {
return nextFilter().clob_setString(this, clob, pos, str, offset, len);
}
return clob.getRawClob().setString(pos, str, offset, len);
}
代码示例来源:origin: com.alibaba/druid
@Override
public int clob_setString(ClobProxy clob, long pos, String str) throws SQLException {
if (this.pos < filterSize) {
return nextFilter().clob_setString(this, clob, pos, str);
}
return clob.getRawClob().setString(pos, str);
}
代码示例来源:origin: co.paralleluniverse/comsat-jdbc
@Override
public Integer call() throws SQLException {
return clob.setString(pos, str);
}
});
代码示例来源:origin: co.paralleluniverse/comsat-jdbc
@Override
public Integer call() throws SQLException {
return clob.setString(pos, str, offset, len);
}
});
代码示例来源:origin: io.snappydata/gemfirexd-core
/**
* {@inheritDoc}
*/
@Override
public int setString(long pos, String str) throws SQLException {
return this.clob.setString(pos, str);
}
代码示例来源:origin: io.snappydata/gemfirexd-core
/**
* {@inheritDoc}
*/
@Override
public int setString(long pos, String str, int offset, int len)
throws SQLException {
return this.clob.setString(pos, str, offset, len);
}
代码示例来源:origin: org.teiid/teiid-common-core
/**
* @see java.sql.Clob#setString(long, java.lang.String, int, int)
*/
public int setString(long pos,
String str,
int offset,
int len) throws SQLException {
return this.reference.setString(pos, str, offset, len);
}
代码示例来源:origin: org.apache.openjpa/openjpa-all
/**
* Invoke the JDK 1.4 <code>setString</code> method on the given CLOB
* object.
*/
public void putString(Clob clob, String data)
throws SQLException {
clob.setString(1L, data);
}
代码示例来源:origin: io.snappydata/snappydata-store-core
/**
* {@inheritDoc}
*/
@Override
public int setString(long pos, String str) throws SQLException {
return this.clob.setString(pos, str);
}
代码示例来源:origin: br.com.anteros/Anteros-Persistence-Core
@Override
public Clob createTemporaryClob(Connection connection, byte[] bytes) throws Exception {
Clob clob = connection.createClob();
clob.setString(1, new String(bytes));
return clob;
}
代码示例来源:origin: stackoverflow.com
Connection con = null;// write code to make a connection object
Clob clob = con.createClob();
String str = "this is a stirng";
clob.setString(0, str );
PreparedStatement ps = null;// write code to create a prepared statement
ps.setClob(4, clob);
代码示例来源:origin: br.org.sesc/sesc-administrativo-core
@Override
public CallableStatement createCallableStatement(Connection con) throws SQLException {
CallableStatement cs = con.prepareCall("{CALL ConsultaFuncionarios.fncConsultaFuncionarios(?)}");
cs.registerOutParameter(1, Types.CLOB);
Connection conn = jdbcExtractor.getNativeConnection(con);
Clob clob = conn.createClob();
clob.setString(1, xml);
cs.setClob(1, clob);
return cs;
}
}, new CallableStatementCallback<String>() {
代码示例来源:origin: org.mule.connectors/mule-db-connector
@Test
public void convertsInputStreamToClob() throws Exception {
String streamContent = "bar";
InputStream value = new StringInputStream(streamContent);
dataType.setParameterValue(statement, PARAM_INDEX, value);
verify(clob).setString(1, streamContent);
verify(statement).setObject(PARAM_INDEX, clob, CLOB);
}
内容来源于网络,如有侵权,请联系作者删除!