• Post Reply Bookmark Topic Watch Topic
  • New Topic

when to use collections?  RSS feed

 
chetna sinha
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi,
i have little knowladge about collections but good in c++.
i am not able to undestand when we save data using collections and when in data base!!!

if i reprashe it,

my question is
when do we need collections to store data and when database?
 
Ulf Dittmer
Rancher
Posts: 42972
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welcome to JavaRanch.

The two methods serve very different purposes. Collections only exist at runtime, making them fast to access, but are gone as soon as the JVM exits.

Databases persist whatever you store in them so that the data is still there the next time you start up your program. But they are much slower to access than anything that's in memory.

Does this answer your question?
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!