db-derby-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Dimple Bhatia" <dim...@gmail.com>
Subject Re: Fwd: Passing in objects to Stored procedures
Date Fri, 05 Oct 2007 23:42:13 GMT
Thanks Rick and Kathey.
Rick, thanks for your workaround of using serialization of the object. I
will try that out.


On 10/5/07, Rick Hillegas <Richard.Hillegas@sun.com> wrote:
>
> Hi Dimple,
>
> In general, the arguments to functions and procedures must be legal
> Derby datatypes. Derby does not currently have a datatype for arbitrary
> Java objects. Adding object support (ADTs) to Derby is tracked by
> DERBY-651.
>
> In the short term, you could try passing your objects as Strings or byte
> arrays. The corresponding datatypes for the database procedure arguments
> would be varchar or varbinary. The client would then be responsible for
> serializing the object as a String or byte array and the actual database
> procedure code would be responsible for deserializing these forms back
> into objects.
>
> Hope this helps,
> -Rick
>
> Dimple Bhatia wrote:
> > Hello,
> > Could someone pls. help me with my question below.
> > Thanks
> > Dimple
> >
> >
> > ---------- Forwarded message ----------
> > From: *Dimple Bhatia* <dimp20@gmail.com <mailto:dimp20@gmail.com>>
> > Date: Oct 2, 2007 10:32 PM
> > Subject: Passing in objects to Stored procedures
> > To: derby-dev <derby-dev@db.apache.org <mailto:derby-dev@db.apache.org>>
> >
> >
> > Hi,
> > I am trying to create a database side procedure(procedure will be
> > created when the database is created) but the input parameter needs to
> > be an object of some class X that I have. I tried to d that and for
> > the arg type,I specified "
> >
> > TypeDescriptor[] arg_types = {
> >
> > DataTypeDescriptor./getSQLDataTypeDescriptor/(
> >
> > "Table" )
> >
> > };"
> >
> > Where Table is the nam eof the Java class who object I will be passing
> > in when calling the store dprocedure.
> >
> > But when issuing the preareCall(), I get a null pointer execpetion in
> >
> > TypeId typeId = TypeId./getBuiltInTypeId/(td.getJDBCTypeId());
> >
> > in resolveRoutine().
> >
> > I thought we are allowed to pass in Java objects to stored procedures
> > but the /getBuiltInTypeId returns null/ since it does include the
> > JAVA_OBJECT type id.
> >
> > Can we create and call java store dprocedures which can take in
> > objects of a class?
> >
> > if so, can someone help with what I maybemissing here.
> >
> > Thanks
> >
> > Dimple.
> >
>
>

Mime
View raw message