@Override
public String getNullableResult(ResultSet rs, int columnIndex) throws SQLException {
String value = "";
Clob clob = rs.getClob(columnIndex);
if (clob != null) {
int size = (int) clob.length();
value = clob.getSubString(1, size);
}
return value;
}
java类java.sql.Clob的实例源码
NClobTypeHandler.java 文件源码
项目:tangyuan2
阅读 20
收藏 0
点赞 0
评论 0
JDBCPreparedStatement.java 文件源码
项目:s-store
阅读 24
收藏 0
点赞 0
评论 0
private void setClobForStringParameter(int parameterIndex,
Clob x) throws SQLException {
if (x instanceof JDBCClob) {
setParameter(parameterIndex, ((JDBCClob) x).data());
return;
} else if (x == null) {
setParameter(parameterIndex, null);
return;
}
checkSetParameterIndex(parameterIndex, false);
final long length = x.length();
if (length > Integer.MAX_VALUE) {
String msg = "Max Clob input character length exceeded: " + length; // NOI18N
throw Util.sqlException(ErrorCode.JDBC_INPUTSTREAM_ERROR, msg);
}
try {
java.io.Reader reader = x.getCharacterStream();
CharArrayWriter writer = new CharArrayWriter(reader, (int) length);
setParameter(parameterIndex, writer.toString());
} catch (IOException e) {
throw Util.sqlException(ErrorCode.SERVER_TRANSFER_CORRUPTED,
e.toString());
}
}
JDBC4ConnectionWrapper.java 文件源码
项目:the-vigilantes
阅读 27
收藏 0
点赞 0
评论 0
/**
* @see java.sql.Connection#createClob()
*/
public Clob createClob() throws SQLException {
checkClosed();
try {
return ((java.sql.Connection) this.mc).createClob();
} catch (SQLException sqlException) {
checkAndFireConnectionError(sqlException);
}
return null; // never reached, but compiler can't tell
}
StubJoinRowSetImpl.java 文件源码
项目:jdk8u-jdk
阅读 36
收藏 0
点赞 0
评论 0
@Override
public void setClob(String parameterName, Clob x) throws SQLException {
throw new UnsupportedOperationException("Not supported yet.");
}
CallableStatementSpy.java 文件源码
项目:dswork
阅读 21
收藏 0
点赞 0
评论 0
public void setClob(String parameterName, Clob x) throws SQLException
{
realCallableStatement.setClob(parameterName, x);
}
ClobSeriliazerTest.java 文件源码
项目:GitHub
阅读 17
收藏 0
点赞 0
评论 0
public void setValue(Clob value) {
this.value = value;
}
JDBCResultSet.java 文件源码
项目:dev-courses
阅读 27
收藏 0
点赞 0
评论 0
/**
* <!-- start generic documentation -->
* Retrieves the value of the designated column in the current row
* of this <code>ResultSet</code> object as a
* <code>java.io.Reader</code> object.
* <!-- end generic documentation -->
*
* <!-- start release-specific documentation -->
* <div class="ReleaseSpecificDocumentation">
* <h3>HSQLDB-Specific Information:</h3> <p>
*
* HSQLDB supports this feature. <p>
* </div>
* <!-- end release-specific documentation -->
*
* @return a <code>java.io.Reader</code> object that contains the column
* value; if the value is SQL <code>NULL</code>, the value returned is
* <code>null</code> in the Java programming language.
* @param columnIndex the first column is 1, the second is 2, ...
* @exception SQLException if a database access error occurs or this method is
* called on a closed result set
* @since JDK 1.2
*/
public java.io.Reader getCharacterStream(
int columnIndex) throws SQLException {
checkColumn(columnIndex);
Type sourceType = resultMetaData.columnTypes[columnIndex - 1];
Object o = getColumnInType(columnIndex, sourceType);
if (o == null) {
return null;
}
if (o instanceof ClobDataID) {
return ((ClobDataID) o).getCharacterStream(session);
} else if (o instanceof Clob) {
return ((Clob) o).getCharacterStream();
} else if (o instanceof String) {
return new StringReader((String) o);
}
throw JDBCUtil.sqlException(ErrorCode.X_42561);
}
StubSyncResolver.java 文件源码
项目:openjdk-jdk10
阅读 28
收藏 0
点赞 0
评论 0
@Override
public void updateClob(int columnIndex, Clob x) throws SQLException {
throw new UnsupportedOperationException("Not supported yet.");
}
JDBC4LoadBalancedMySQLConnection.java 文件源码
项目:the-vigilantes
阅读 22
收藏 0
点赞 0
评论 0
/**
* @see java.sql.Connection#createClob()
*/
public Clob createClob() {
return this.getJDBC4Connection().createClob();
}
AbstractBlancoGenericJdbcConnection.java 文件源码
项目:blanco-sfdc-jdbc-driver
阅读 15
收藏 0
点赞 0
评论 0
public Clob createClob() throws SQLException {
throw new SQLException("Not Implemented: createClob()");
}