• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Performance between Array list and StringBuffer to store Large amount of data?

 
Greenhorn
Posts: 14
Scala Redhat Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Hi all,

i am supposed to send the specific huge data to another class as parameter.
That Input Parameter in second class is necessary to make iterate in Resultset to get specific data.

can i send the parameter as StringBuffer or Array list.

When i send as StringBuffer It might be blocks of strings like

((a,b,c) in ((1,...),(...),(...),............(n,...)) if it is large data means it might be like long and takes more time to search any data.

When i send as stringbuffer, i have to split the string buffer using StringTokenizer .
But it got failed due to usage of special characters(comma,=)

which is best for handling huge amount of data.........
 
Marshal
Posts: 28193
95
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You've already found out that using a StringBuffer is a big headache from the programming point of view, whereas an ArrayList is not a problem at all. So there's your answer: ArrayList is better.

I'm not answering your question about performance because (a) it's the wrong question to ask at this point, and (b) it's a bad question because you haven't said what kind of "performance" you were thinking of.
 
Ranch Hand
Posts: 326
Android Mac OS X Firefox Browser
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
From a class/methods point of view, it is no difference if you send a REFERENCE to a StringBuffer object or a REFERENCE to an ArrayList. If you would draw it on a paper, the line connecting your class with the instance of the StringBuffer or the ArrayList is the same.

When sending large amounts of data to a class, it should be done in a structured way. What is in the array that you are going to send?
 
Gopi Nash
Greenhorn
Posts: 14
Scala Redhat Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Ove Lindström wrote:From a class/methods point of view, it is no difference if you send a REFERENCE to a StringBuffer object or a REFERENCE to an ArrayList. If you would draw it on a paper, the line connecting your class with the instance of the StringBuffer or the ArrayList is the same.

When sending large amounts of data to a class, it should be done in a structured way. What is in the array that you are going to send?



(HeaderString,Timestamp,String,String)

Three values for specific HeaderString value, it will be send using ProcessInfo and Worker class

Destination class will have Header string value and search in Incoming Parameter value via Resultset
 
Ove Lindström
Ranch Hand
Posts: 326
Android Mac OS X Firefox Browser
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Gopi Nash wrote:

Ove Lindström wrote:From a class/methods point of view, it is no difference if you send a REFERENCE to a StringBuffer object or a REFERENCE to an ArrayList. If you would draw it on a paper, the line connecting your class with the instance of the StringBuffer or the ArrayList is the same.

When sending large amounts of data to a class, it should be done in a structured way. What is in the array that you are going to send?



(HeaderString,Timestamp,String,String)

Three values for specific HeaderString value, it will be send using ProcessInfo and Worker class

Destination class will have Header string value and search in Incoming Parameter value via Resultset



So, if I get you right, you want to pack four (4) different values into an Array to sent do a method? I think I am missing something here...
 
reply
    Bookmark Topic Watch Topic
  • New Topic