Java 类java.sql.NClob 实例源码

项目:ProyectoPacientes    文件:JDBC4ResultSet.java   
@SuppressWarnings("unchecked")
public <T> T getObject(int columnIndex, Class<T> type) throws SQLException {
    if (type == null) {
        throw SQLError.createSQLException("Type parameter can not be null", SQLError.SQL_STATE_ILLEGAL_ARGUMENT, getExceptionInterceptor());
    }

    if (type.equals(Struct.class)) {
        throw new SQLFeatureNotSupportedException();
    } else if (type.equals(RowId.class)) {
        return (T) getRowId(columnIndex);
    } else if (type.equals(NClob.class)) {
        return (T) getNClob(columnIndex);
    } else if (type.equals(SQLXML.class)) {
        return (T) getSQLXML(columnIndex);
    }

    return super.getObject(columnIndex, type);
}
项目:BibliotecaPS    文件:JDBC4UpdatableResultSet.java   
/**
 * JDBC 4.0 Get a NCLOB column.
 * 
 * @param i
 *            the first column is 1, the second is 2, ...
 * 
 * @return an object representing a NCLOB
 * 
 * @throws SQLException
 *             if an error occurs
 */
public NClob getNClob(int columnIndex) throws SQLException {
    String fieldEncoding = this.fields[columnIndex - 1].getEncoding();

    if (fieldEncoding == null || !fieldEncoding.equals("UTF-8")) {
        throw new SQLException("Can not call getNClob() when field's charset isn't UTF-8");
    }

    if (!this.isBinaryEncoded) {
        String asString = getStringForNClob(columnIndex);

        if (asString == null) {
            return null;
        }

        return new com.mysql.jdbc.JDBC4NClob(asString, getExceptionInterceptor());
    }

    return getNativeNClob(columnIndex);
}
项目:lams    文件:JDBC4UpdatableResultSet.java   
/**
 * @see ResultSet#updateNClob(int, NClob)
 */
public void updateNClob(int columnIndex, java.sql.NClob nClob) throws SQLException {
    String fieldEncoding = this.fields[columnIndex - 1].getEncoding();
    if (fieldEncoding == null || !fieldEncoding.equals("UTF-8")) {
        throw new SQLException("Can not call updateNClob() when field's character set isn't UTF-8");
    }

    if (nClob == null) {
        updateNull(columnIndex);
    } else {
        updateNCharacterStream(columnIndex, nClob.getCharacterStream(), (int) nClob.length());
    }
}
项目:lams    文件:NClobTypeDescriptor.java   
@SuppressWarnings({ "unchecked" })
public <X> X unwrap(final NClob value, Class<X> type, WrapperOptions options) {
    if ( value == null ) {
        return null;
    }

    try {
        if ( CharacterStream.class.isAssignableFrom( type ) ) {
            if ( NClobImplementer.class.isInstance( value ) ) {
                // if the incoming NClob is a wrapper, just pass along its BinaryStream
                return (X) ( (NClobImplementer) value ).getUnderlyingStream();
            }
            else {
                // otherwise we need to build a BinaryStream...
                return (X) new CharacterStreamImpl( DataHelper.extractString( value.getCharacterStream() ) );
            }
        }
        else if (NClob.class.isAssignableFrom( type )) {
            final NClob nclob =  WrappedNClob.class.isInstance( value )
                    ? ( (WrappedNClob) value ).getWrappedNClob()
                    : value;
            return (X) nclob;
        }
    }
    catch ( SQLException e ) {
        throw new HibernateException( "Unable to access nclob stream", e );
    }

    throw unknownUnwrap( type );
}
项目:s-store    文件:JDBC4ResultSet.java   
@Override
public NClob getNClob(int columnIndex) throws SQLException {
    checkColumnBounds(columnIndex);
    try {
        return new JDBC4NClob(table.getString(columnIndex - 1)
                .toCharArray());
    } catch (Exception x) {
        throw SQLError.get(x);
    }
}
项目:BibliotecaPS    文件:JDBC4CallableStatementWrapper.java   
public NClob getNClob(int parameterIndex) throws SQLException {
    try {
        if (this.wrappedStmt != null) {
            return ((CallableStatement) this.wrappedStmt).getNClob(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;
}
项目:lams    文件:ContextualLobCreator.java   
@Override
public NClob createNClob(String string) {
    try {
        final NClob nclob = createNClob();
        nclob.setString( 1, string );
        return nclob;
    }
    catch ( SQLException e ) {
        throw new JDBCException( "Unable to set NCLOB string after creation", e );
    }
}
项目:ProyectoPacientes    文件:JDBC4ConnectionWrapper.java   
/**
 * @see java.sql.Connection#createNClob()
 */
public NClob createNClob() throws SQLException {
    checkClosed();

    try {
        return ((java.sql.Connection) this.mc).createNClob();
    } catch (SQLException sqlException) {
        checkAndFireConnectionError(sqlException);
    }

    return null; // never reached, but compiler can't tell
}
项目:dswork.jdbc    文件:ConnectionSpy.java   
public NClob createNClob() throws SQLException
{
    try
    {
        return realConnection.createNClob();
    }
    catch(SQLException s)
    {
        String methodCall = "createNClob()";
        reportException(methodCall, s, null);
        throw s;
    }
}
项目:BibliotecaPS    文件:JDBC4CallableStatementWrapper.java   
/**
 * @see java.sql.CallableStatement#getNClob(java.lang.String)
 */
public NClob getNClob(String parameterName) throws SQLException {
    try {
        if (this.wrappedStmt != null) {
            return ((CallableStatement) this.wrappedStmt).getNClob(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;
}
项目:BibliotecaPS    文件:JDBC4CallableStatementWrapper.java   
public void setNClob(String parameterName, NClob value) throws SQLException {
    try {
        if (this.wrappedStmt != null) {
            ((CallableStatement) this.wrappedStmt).setNClob(parameterName, value);
        } else {
            throw SQLError.createSQLException("No operations allowed after statement closed", SQLError.SQL_STATE_GENERAL_ERROR, this.exceptionInterceptor);
        }
    } catch (SQLException sqlEx) {
        checkAndFireConnectionError(sqlEx);
    }
}
项目:spanner-jdbc    文件:AbstractCloudSpannerResultSet.java   
@Override
public void updateNClob(String columnLabel, NClob nClob) throws SQLException
{
    throw new SQLFeatureNotSupportedException();
}
项目:openjdk-jdk10    文件:StubJoinRowSetImpl.java   
@Override
public void updateNClob(String columnLabel, NClob nClob) throws SQLException {
    throw new UnsupportedOperationException("Not supported yet.");
}
项目:dswork.jdbc    文件:CallableStatementSpy.java   
public NClob getNClob(String parameterName) throws SQLException
{
    return realCallableStatement.getNClob(parameterName);
}
项目:jdk8u-jdk    文件:StubJoinRowSetImpl.java   
@Override
public NClob getNClob(String columnLabel) throws SQLException {
    throw new UnsupportedOperationException("Not supported yet.");
}
项目:QDrill    文件:DrillResultSetImpl.java   
@Override
public NClob getNClob( String columnLabel ) throws SQLException {
  checkNotClosed();
  return super.getNClob( columnLabel );
}
项目:agroal    文件:MockResultSet.java   
@Override
default void updateNClob(int columnIndex, NClob nClob) throws SQLException {
}
项目:incubator-netbeans    文件:ResultSetAdapter.java   
@Override
public void updateNClob(String columnLabel, NClob nClob) throws SQLException {
    throw new UnsupportedOperationException("Not supported yet.");
}
项目:lams    文件:JDBC4ResultSet.java   
private final java.sql.NClob getNClobFromString(String stringVal, int columnIndex) throws SQLException {
    return new com.mysql.jdbc.JDBC4NClob(stringVal, getExceptionInterceptor());
}
项目:lams    文件:NonContextualLobCreator.java   
@Override
public NClob createNClob(Reader reader, long length) {
    return NClobProxy.generateProxy( reader, length );
}
项目:incubator-netbeans    文件:SQLStatement.java   
void setNClob(int parameterIndex, NClob value) {
    parameters.ensureCapacity(parameterIndex+1);
}
项目:elastic-db-tools-for-java    文件:MultiShardResultSet.java   
@Override
public NClob getNClob(String columnLabel) throws SQLException {
    return this.getCurrentResultSet().getNClob(columnLabel);
}
项目:ProyectoPacientes    文件:JDBC4UpdatableResultSet.java   
/**
 * @see ResultSet#updateClob(int, Clob)
 */
public void updateNClob(String columnName, java.sql.NClob nClob) throws SQLException {
    updateNClob(findColumn(columnName), nClob);
}
项目:openjdk-jdk10    文件:StubFilteredRowSetImpl.java   
@Override
public void setNClob(String parameterName, NClob value) throws SQLException {
    throw new UnsupportedOperationException("Not supported yet.");
}
项目:OpenVertretung    文件:JDBC4Connection.java   
/**
 * @see java.sql.Connection#createNClob()
 */
public NClob createNClob() {
    return new com.mysql.jdbc.JDBC4NClob(getExceptionInterceptor());
}
项目:lams    文件:JDBC4MultiHostMySQLConnection.java   
/**
 * @see java.sql.Connection#createNClob()
 */
public NClob createNClob() {
    return this.getJDBC4Connection().createNClob();
}
项目:lams    文件:NClobTypeDescriptor.java   
@Override
public int extractHashCode(NClob value) {
    return System.identityHashCode( value );
}
项目:jdk8u-jdk    文件:StubSyncResolver.java   
@Override
public void setNClob(int parameterIndex, NClob value) throws SQLException {
    throw new UnsupportedOperationException("Not supported yet.");
}
项目:s-store    文件:JDBC4ResultSet.java   
@Override
public NClob getNClob(String columnLabel) throws SQLException {
    return getNClob(findColumn(columnLabel));
}
项目:jdk8u-jdk    文件:StubConnection.java   
@Override
public NClob createNClob() throws SQLException {
    throw new UnsupportedOperationException("Not supported yet.");
}
项目:agroal    文件:CallableStatementWrapper.java   
@Override
public NClob getNClob(int parameterIndex) throws SQLException {
    return wrappedStatement.getNClob( parameterIndex );
}
项目:dremio-oss    文件:DremioResultSetImpl.java   
@Override
public NClob getNClob( int columnIndex ) throws SQLException {
  throwIfClosed();
  return super.getNClob( columnIndex );
}
项目:jdk8u-jdk    文件:StubFilteredRowSetImpl.java   
@Override
public NClob getNClob(String columnLabel) throws SQLException {
    throw new UnsupportedOperationException("Not supported yet.");
}
项目:openjdk-jdk10    文件:StubCachedRowSetImpl.java   
@Override
public void updateNClob(int columnIndex, NClob nClob) throws SQLException {
    throw new UnsupportedOperationException("Not supported yet.");
}
项目:lams    文件:JDBC4Connection.java   
/**
 * @see java.sql.Connection#createNClob()
 */
public NClob createNClob() {
    return new com.mysql.jdbc.JDBC4NClob(getExceptionInterceptor());
}
项目:lams    文件:SessionImpl.java   
@Override
public NClob createNClob(String string) {
    return lobCreator().createNClob( string );
}
项目:openjdk-jdk10    文件:StubWebRowSetImpl.java   
@Override
public void updateNClob(int columnIndex, NClob nClob) throws SQLException {
    throw new UnsupportedOperationException("Not supported yet.");
}
项目:jdk8u-jdk    文件:StubCachedRowSetImpl.java   
@Override
public void setNClob(int parameterIndex, NClob value) throws SQLException {
    throw new UnsupportedOperationException("Not supported yet.");
}
项目:s-store    文件:JDBC4ResultSet.java   
@Override
public void updateNClob(String columnLabel, NClob nClob)
        throws SQLException {
    throw SQLError.noSupport();
}
项目:jdk8u-jdk    文件:StubCachedRowSetImpl.java   
@Override
public void updateNClob(int columnIndex, NClob nClob) throws SQLException {
    throw new UnsupportedOperationException("Not supported yet.");
}