Storing Objects in Oracle Database?

Storing Objects in Oracle Database?

Post by quereinsteig » Thu, 07 Nov 2002 20:51:18



Can I store a whole object in Oracle 9i?

I am tired of these two separate worlds: Object Oriented Programming
(Java) and converting the objects manually for storage in relational
databases!

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)?

 
 
 

Storing Objects in Oracle Database?

Post by Nuno Sout » Thu, 07 Nov 2002 21:01:17


6 Nov 2002 03:51:18 -0800,  quereinsteiger said (and I quote):

Quote:> Can I store a whole object in Oracle 9i?

Only if it is defined in the database as well.

Quote:

> 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...

Quote:

> 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


 
 
 

Storing Objects in Oracle Database?

Post by Galen Boye » Fri, 08 Nov 2002 12:31:54



Quote:> I am tired of these two separate worlds: Object Oriented Programming
> (Java) and converting the objects manually for storage in relational
> databases!

It sort of sucks when all you want to do is make sure the client has a
pleasant experience interacting with the app you are writing, but the
idea is to make sure your data's integrity is protected.  This isn't an
easy thing to accomplish but it also isn't an easy thing to get across
to armys of OO programmers, the data is going to survive long after any
application will, no matter how much the latest paradigm will promise
you that its way is the only way.

I still get money from an IBM mainframe, cause it is alot more important
to banks that my account isn't screwed up than it is that I have the
world's most perfect banking experience.

--
Galen deForest Boyer
Sweet dreams and flying machines in pieces on the ground.

 
 
 

1. mmmyql driver doesn't store a vector object in mysql database (changes serialized object string)

hello,

i'd appreciate any help on the problem i keep having since i'm running
out ouf ideas.
i tried to store a vector object using the mmmysql driver 1.2 and 2.0pre
in a mysql database (win32 version 3.21).
as you can imagine, the serialized vector object contains a lot of
unusual ascii characters. when i write the object to a file and read it
in using "load infile .." mysql inserts it without any problems.
using the drivers setObject() or setBinaryStream() methods not a single
character of the object reaches the database, just two ascii signs (not
contained in the serialized object string) and a lot of spaces.
to make it even worse, a result query (ResultSet rs
= executeQuery("select * from tableX")) to select this row doesn't even
return!!

if anyone could help me, i'd be glad.

thanks in advance,

sebastian

PS: i tried the original "store objects in database for persistence"
example in http://www.codeguru.com with the same result

Sent via Deja.com http://www.deja.com/
Before you buy.

2. SQL Server Chat: Advanced SQL Server Stored Procedure Programming

3. NC-Durham-267858--ORACLE-Relational Database-Database Applications-Object Orient

4. Problems with ComboBox and SQL Server (via ODBC)

5. 24075-IN-Indianapolis-Business Objects-ORACLE-SQL-Business Objects, Oracle

6. request for info on strudel, chaos

7. Storing objects in a database

8. Dumping multiple databases to ONE tape

9. how to script my database objects weekly with stored proc running in a job

10. Returning a database object in stored procedures

11. Storing of group permissions to database objects

12. stored procedure accessing objects in other database