my dog learned polymorphism*
The moose likes JDBC and the fly likes How to convert from database to Java Collection? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "How to convert from database to Java Collection?" Watch "How to convert from database to Java Collection?" New topic
Author

How to convert from database to Java Collection?

ramanuja varun
Ranch Hand

Joined: Aug 31, 2007
Posts: 47
how to persist data from a database to a java collection(eg list)

i have a table in oracle and want to do some processing on it in java. how to get it in collections

[Please UseAMeaningfulSubjectLine - Dave]
[ February 26, 2008: Message edited by: David O'Meara ]
Paul Sturrock
Bartender

Joined: Apr 14, 2004
Posts: 10336

There is no "get results as collection" method in JDBC. You will need to iterate through a ResultSet adding each record to whichever Collection implementation you want.


JavaRanch FAQ HowToAskQuestionsOnJavaRanch
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: How to convert from database to Java Collection?
 
Similar Threads
scenario based question on core java
This name right?
Thangaraj S.
core java
Core Java