my dog learned polymorphism*
The moose likes JDBC and the fly likes How to retrieve data objects from ResultSet Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "How to retrieve data objects from ResultSet" Watch "How to retrieve data objects from ResultSet" New topic
Author

How to retrieve data objects from ResultSet

abhi
Greenhorn

Joined: Dec 27, 2000
Posts: 4
Hi friends,
Well. I have been using Oracle8 in my project. Till now i have not used the data objects in Oracle. If i retrieved the data object using SQL query from Oracle8 database...ofcourse it will be received into my servlets as Resultset. How can i extract the member variables of this oracle data object. Please help it out.
Thanks .
Can you be specific and show us the exact data type in Oracle.
If it's a blob field, use ResultSet.getBlob().
If it's a JAVA data object, use ResultSet.getObject().
-Peter
Hi Peter,
Thanks. Sorry for the delay in interacting with you for further owing to bit busy. My exact doubt is that,
In Oracle8,
Suppose i have stored the data as object called "Address" in "EMP" table,ofcourse "EMP" table also contains some primitive type fields.
An object "Address" includes its member vars,
House No (varchar(15)),
Street (varchar(20).
By excuting the following query using JDBC,
"Select Address from EMP" i got the ResultSet. Then how can i extract the "Address" object and its subfields(i.e "House No" and "Street")from ResultSet.
Hope you got my doubt. Please explain.
Venu.



[This message has been edited by venugopal naradas (edited January 13, 2001).]
Peter Tran
Bartender

Joined: Jan 02, 2001
Posts: 783
Can you be specific and show us the exact data type in Oracle.
If it's a blob field, use ResultSet.getBlob().
If it's a JAVA data object, use ResultSet.getObject().
-Peter
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: How to retrieve data objects from ResultSet
 
Similar Threads
Delete doubt
Dynamic SQL Query Doubt
oracle and jdbc-odbc bridge
doubt using resultsets and queries in servlets
doubt in resultsets and queries in servlets