Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> Re: Storing Objects in Oracle Database?
6 Nov 2002 03:51:18 -0800, quereinsteiger said (and I quote):
> Can I store a whole object in Oracle 9i?
Only if it is defined in the database as well.
>
> I am tired of these two separate worlds: Object Oriented Programming
> (Java) and converting the objects manually for storage in relational
> databases!
Welcome to the club...
>
> Is it possible to store a object which contains all the needed
> information by just passing it to the Oracle database (or a similiar
> easy way)?
>
No, of course not. Oracle doesn't know anything of the methods associated with any arbitrary Java class. You'd have to define the class within the database engine and then use the DB JRE.
Having said that, nowadays (since 8iR3) you can use JDBC to pass the contents of an object as a struct in a single transmission. That's a big change from the old column-at-a-time way. Basically you can pass the entire row in one go and have JDBC split it into the appropriate bits into an object. It won't have any method callbacks attached to it, though. Which probably is a good thing.
-- Cheers Nuno Souto nsouto_at_optusnet.com.au.nospamReceived on Wed Nov 06 2002 - 06:01:17 CST
![]() |
![]() |