java.sql.Clob

From: Mark (mark.harris.nospam_at_ukonline.co.uk.nospam)
Date: 04/28/04

  • Next message: Matt Parker: "Re: Serving PDF from a servlet - blank screen in IE"
    Date: Wed, 28 Apr 2004 14:18:41 +0100
    
    

    Hello,

    I am creating a class which has an instance variable of type java.sql.Clob.

    Within the class, I'm attempting to write a copy() method which will create
    a duplicate of an object of that type.

    I'm getting unstuck when trying to understand how to copy across the data
    held within the Clob instance variable. For String variables, for example, I
    can do something like:

        MyClass myCopy = new MyClass();
        myCopy.name = new String(name);

    (where name is an instance variable of type String)

    java.sql.Clob is an interface, and, as such, I can't do something like:

        myCopy.clobVariable = new java.sql.Clob(clobVariable);

    If I do something like this:

        myCopy.clobVariable = clobVariable;

    I'm guessing that I'm just copying the reference to the data, rather than
    the data itself.

    Many thanks for any assistance.

    Mark


  • Next message: Matt Parker: "Re: Serving PDF from a servlet - blank screen in IE"