• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

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

 
Gopi Nash
Greenhorn
Posts: 14
Redhat Scala Ubuntu
  • Mark post as helpful
  • send pies
  • 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.........
 
Paul Clapham
Sheriff
Posts: 21111
32
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • 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.
 
Ove Lindström
Ranch Hand
Posts: 326
Android Firefox Browser Mac OS X
  • Mark post as helpful
  • send pies
  • 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
Redhat Scala Ubuntu
  • Mark post as helpful
  • send pies
  • 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 Firefox Browser Mac OS X
  • Mark post as helpful
  • send pies
  • 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...
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic