You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tuscany.apache.org by Amita Vadhavkar <am...@gmail.com> on 2007/07/13 13:27:02 UTC

Re: Does DAS could support the blob field read and write ?

Hi All,
In an attempt to see how to ensure support from DAS to Blob, Clob etc. I
tried
a MySQL table with Blob column having some rows and tried to access it using
DAS. It could not go through and on the way of debugging - I finally wrote
the below
code (part from
org.apache.tuscany.das.rdb.graphbuilder.schema.ResultSetTypeMap),
to see what is supported and what is not.
---------------------------------------------------------------------------------------------------------------------------
public class TestSupportedTypes {
//picked from
org.apache.tuscany.das.rdb.graphbuilder.schema.ResultSetTypeMap
    public static void main(String[] args){
        TypeHelper helper = TypeHelper.INSTANCE;
        SDOPackage.eINSTANCE.eClass();//what is this for
        if(helper.getType("commonj.sdo", "String") == null){
            System.out.println("String Not supported!");
        }
        if(helper.getType("commonj.sdo", "Decimal") == null){
            System.out.println("Decimal Not supported!");
        }
        if(helper.getType("commonj.sdo", "Boolean") == null){
            System.out.println("Boolean Not supported!");
        }
        if(helper.getType("commonj.sdo", "boolean") == null){
            System.out.println("boolean Not supported!");
        }
        if(helper.getType("commonj.sdo", "IntObject") == null){
            System.out.println("IntObject Not supported!");
        }
        if(helper.getType("commonj.sdo", "Int") == null){
            System.out.println("Int Not supported!");
        }
        if(helper.getType("commonj.sdo", "Long") == null){
            System.out.println("Long Not supported!");
        }
        if(helper.getType("commonj.sdo", "long") == null){
            System.out.println("long Not supported!");
        }
        if(helper.getType("commonj.sdo", "Float") == null){
            System.out.println("Float Not supported!");
        }
        if(helper.getType("commonj.sdo", "float") == null){
            System.out.println("float Not supported!");
        }
        if(helper.getType("commonj.sdo", "Double") == null){
            System.out.println("Double Not supported!");
        }
        if(helper.getType("commonj.sdo", "double") == null){
            System.out.println("double Not supported!");
        }
        if(helper.getType("commonj.sdo", "ByteArray") == null){
            System.out.println("ByteArray Not supported!");
        }
        if(helper.getType("commonj.sdo", "Date") == null){
            System.out.println("Date Not supported!");
        }
        if(helper.getType("commonj.sdo", "Clob") == null){
            System.out.println("Clob Not supported!");
        }
        if(helper.getType("commonj.sdo", "Blob") == null){
            System.out.println("Blob Not supported!");
        }
        if(helper.getType("commonj.sdo", "Array") == null){
            System.out.println("Array Not supported!");
        }
        if(helper.getType("commonj.sdo", "Object") == null){
            System.out.println("Object Not supported!");
        }
    }
}

The result is :----------------------------------------------------------
boolean Not supported!
long Not supported!
float Not supported!
double Not supported!
ByteArray Not supported!
Clob Not supported!
Blob Not supported!
Array Not supported!
--------------------------------------------------------------------------------------------
Thus for all the above, in RDB DAS, getEDataType() returns null and then
finally gets a
NPE in GraphBuilderMetaData,createDynamicTypes() , when calling
SDOUtil.createProperty(), due to this null commonj.sdo.Type.

Please let me know if I am doing something totally wrong here. And what is
the way
to make RDB DAS work for the above Types.

Regards,
Amita

On 7/13/07, Amita Vadhavkar <am...@gmail.com> wrote:
>
> Hi,
> There is none at present, am giving it a try, will give you some update in
> couple of hrs.
> Regards,
> Amita
>
> On 7/13/07, litaojian <li...@21cn.com> wrote:
> >
> > Hi Amita ,
> > Thanks , but where is the sample that I could find ?
> >
> >
> >
> >
> >
> > litaojian
> > 2007-07-13
> >
> >
> >
> > 发件人: Amita Vadhavkar
> > 发送时间: 2007-07-13 17:08:11
> > 收件人: tuscany-user@ws.apache.org
> > 抄送:
> > 主题: Re: Does DAS could support the blob field read and write ?
> >
> > Hi,
> > DAS does show support for Blob. I am trying a small sample with MySQL
> > -DAS
> > to verify
> > the same. There is  also a DefaultConverter provided in DAS Impl which
> > seems
> > to
> > be there for handling Blobs.
> > Thanks,
> > Amita
> >
> > On 7/13/07, litaojian  <litaojian@21cn.com > wrote:
> > >
> > > Hi All ,
> > >        I need to read or write  the image data from database blob
> > field ,
> > > Does the DAS support it ?  Is there any solution for this problem ?
> > >
> > >
> > > Best regards ,
> > >
> > >
> > >
> > >
> > > litaojian
> > > 2007-07-13
> > >
> >
>
>