aspose file tools*
The moose likes JDBC and the fly likes Convert List to ResultSet? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "Convert List to ResultSet?" Watch "Convert List to ResultSet?" New topic
Author

Convert List to ResultSet?

abu alfouz
Ranch Hand

Joined: Nov 20, 2006
Posts: 44
Hi
I need to convert List to ResultSet, how can I do that?

Thank you..


SCJP 1.5
SCWCD 1.4
David O'Meara
Rancher

Joined: Mar 06, 2001
Posts: 13459

Can you explain why? Understanding this would help us provide an answer.

The problem here is that there is no direct mapping from a List to a ResultSet. Even if the List contained all of the same object and you wanted to map each of these to a row in the ResultSet, this still isn't straight forward. There are, however tools like ORM (object-relational mapping) tools that can do some of the work for you. Does this help?
abu alfouz
Ranch Hand

Joined: Nov 20, 2006
Posts: 44
This is because I need the meta data from the result set.
Rahul Bhattacharjee
Ranch Hand

Joined: Nov 29, 2005
Posts: 2308
Originally posted by abu alfouz:
This is because I need the meta data from the result set.


It's not possible.You can get metadata information from ResultSets obtained as a result of execution.

If you have all the database credentials then why do not you follow the standard procedure to connect to the database and get the metadata information using JDBC.
;)
[ July 26, 2007: Message edited by: Rahul Bhattacharjee ]

Rahul Bhattacharjee
LinkedIn - Blog
abu alfouz
Ranch Hand

Joined: Nov 20, 2006
Posts: 44
Because I use Oracle TopLink to connect to database.
[ July 26, 2007: Message edited by: abu alfouz ]
Rahul Bhattacharjee
Ranch Hand

Joined: Nov 29, 2005
Posts: 2308
Originally posted by abu alfouz:
Because I use Oracle TopLink to connect to database.


TopLink is an ORM that David was talking about.
I have not used it , but I am sure that it has some way to give you the metadata information.
If there is nothing in Toplink then whether TopLink allows simple JDBC query ?
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Convert List to ResultSet?