All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.firebirdsql.jdbc.FBClob Maven / Gradle / Ivy

There is a newer version: 6.0.0-beta-1
Show newest version
/*
 * Firebird Open Source J2ee connector - jdbc driver
 *
 * Distributable under LGPL license.
 * You may obtain a copy of the License at http://www.gnu.org/copyleft/lgpl.html
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * LGPL License for more details.
 *
 * This file was created by members of the firebird development team.
 * All individual contributions remain the Copyright (C) of those
 * individuals.  Contributors to this file are either listed here or
 * can be obtained from a CVS history command.
 *
 * All rights reserved.
 */

package org.firebirdsql.jdbc;


import java.io.InputStream;
import java.io.OutputStream;
import java.io.Reader;
import java.io.Writer;
import java.sql.Clob;
import java.sql.SQLException;



/**
 * The mapping in the JavaTM programming language for the SQL CLOB type. 
 * An SQL CLOB is a built-in type that stores a Character Large Object as a 
 * column value in a row of a database table. CLOBS are not currently 
 * supported by the Jaybird driver.
 * 
 * The Clob interface provides methods for getting the length of an SQL CLOB 
 * (Character Large Object) value, for materializing a CLOB value on the 
 * client, and for searching for a substring or CLOB object within a CLOB 
 * value. Methods in the interfaces ResultSet, CallableStatement, and 
 * PreparedStatement, such as getClob and setClob allow a programmer to access 
 * an SQL CLOB value. In addition, this interface has methods for updating a 
 * CLOB value. 
 *
 * @author David Jencks
 * @version 1.0
 */
public class FBClob implements Clob {

  /**
   * Returns the number of characters
   * in the CLOB value
   * designated by this Clob object.
   * @return length of the CLOB in characters
   * @exception SQLException if there is an error accessing the
   * length of the CLOB
   * @since 1.2
   * @see What Is in the JDBC 2.0 API
   */
    public long length() throws SQLException {
        throw new FBDriverNotCapableException();
    }

    /**
     * This operation is not currently supported
     * Truncate this Clob to a given length. 
     *
     * @param param1 The length to truncate this Clob to 
     * @exception java.sql.SQLException this operation is not supported     
     */
    public void truncate(long param1) throws SQLException {
        throw new FBDriverNotCapableException();
    }



  /**
   * Returns a copy of the specified substring
   * in the CLOB value
   * designated by this Clob object.
   * The substring begins at position
   * pos and has up to length consecutive
   * characters.
   * @param pos the first character of the substring to be extracted.
   *            The first character is at position 1.
   * @param length the number of consecutive characters to be copied
   * @return a String that is the specified substring in
   *         the CLOB value designated by this Clob object
   * @exception SQLException if there is an error accessing the
   * CLOB
   * @since 1.2
   * @see What Is in the JDBC 2.0 API
   */
    public String getSubString(long pos, int length) throws SQLException {
        throw new FBDriverNotCapableException();
    }


  /**
   * Gets the CLOB value designated by this Clob
   * object as a Unicode stream.
   * @return a Unicode stream containing the CLOB data
   * @exception SQLException if there is an error accessing the
   * CLOB value
   * @since 1.2
   * @see What Is in the JDBC 2.0 API
   */
    public Reader getCharacterStream() throws SQLException {
        throw new FBDriverNotCapableException();
    }


  /**
   * Gets the CLOB value designated by this Clob
   * object as a stream of Ascii bytes.
   * @return an ascii stream containing the CLOB data
   * @exception SQLException if there is an error accessing the
   * CLOB value
   * @since 1.2
   * @see What Is in the JDBC 2.0 API
   */
    public InputStream getAsciiStream() throws SQLException {
        throw new FBDriverNotCapableException();
    }


  /**
   * Determines the character position at which the specified substring
   * searchstr appears in the SQL CLOB value
   * represented by this Clob object.  The search
   * begins at position start.
   * @param searchstr the substring for which to search
   * @param start the position at which to begin searching; the first position
   *              is 1
   * @return the position at which the substring appears, else -1; the first
   *         position is 1
   * @exception SQLException if there is an error accessing the
   * CLOB value
   * @since 1.2
   * @see What Is in the JDBC 2.0 API
   */
    public long position(String searchstr, long start) throws SQLException {
        throw new FBDriverNotCapableException();
    }


  /**
   * Determines the character position at which the specified
   * Clob object searchstr appears in this
   * Clob object.  The search begins at position
   * start.
   * @param searchstr the Clob object for which to search
   * @param start the position at which to begin searching; the first
   *              position is 1
   * @return the position at which the Clob object appears,
   * else -1; the first position is 1
   * @exception SQLException if there is an error accessing the
   * CLOB value
   * @since 1.2
   * @see What Is in the JDBC 2.0 API
   */
    public long position(Clob searchstr, long start) throws SQLException {
        throw new FBDriverNotCapableException();
    }

    /**
     * This operation is not supported
     * Writes the given Java String to the CLOB value that this 
     * Clob object designates at the position pos. 
     *
     * @param param1 position at which to start writing 
     * @param param2 The String value to write 
     * @return The number of characters written
     * @exception java.sql.SQLException because this operation is not supported 
     */
    public int setString(long param1, String param2) throws SQLException {
        throw new FBDriverNotCapableException();

    }

    /**
     * This operation is not supported
     *
     * @param param1 
     * @param param2 
     * @param param3 
     * @param param4 
     * @return 
     * @exception java.sql.SQLException 
     */
    public int setString(long param1, String param2, int param3, int param4) throws SQLException {
        throw new FBDriverNotCapableException();

    }

    /**
     * This operation is not supported
     *
     * @param param1 
     * @return 
     * @exception java.sql.SQLException 
     */
    public OutputStream setAsciiStream(long param1) throws SQLException {
        throw new FBDriverNotCapableException();
    }

    /**
     * This operation is not supported
     *
     * @param param1 
     * @return 
     * @exception java.sql.SQLException 
     */
    public Writer setCharacterStream(long param1) throws SQLException {
        throw new FBDriverNotCapableException();
    }

    public void free() throws SQLException {
        // empty
    }

    public Reader getCharacterStream(long pos, long length) throws SQLException {
        throw new FBDriverNotCapableException();
    }

    

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy