This week's giveaway is in the Threads forum.
We're giving away four copies of Java Concurrency Live Lessons and have Doug Schmidt on-line!
See this thread for details.
Win a copy of Java Concurrency Live Lessons this week in the Threads forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Objects, ArrayList and a Jsp but not Databases  RSS feed

 
Maki Jav
Ranch Hand
Posts: 449
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,

Output of my readwrite.jsp

ADIL
ANIS
SHAHZAD
No of records= 100002
Record No 100002 is ADIL
8080 ms

This jsp is saving an Object Badarian of type Badarian



The class Badarian... Getters/Setters not shown


My questions are:
Comparision-wise, does other type of technologies Asp.net/PHP take as long as my Jsp (about 8 seconds)to save an object to a file. then retrieve the 100002th record
from that file and display it.

The file size is 401 bytes for the record of this size. Is this not amazing?It was of the same size for 10002 records!

Performance-wise is it a good code? I am talking about performance while staying within the Java context.

Does a database takes this much longer, if used with some web-based technology
like Jsps.

Summary of my questions would be, do I have to loose much if I use objects, ArrayList,
file of my choice, Jsps; And not going for databases/ other techs.

Thanx in Advance

Maki Jav
[ December 13, 2004: Message edited by: Maki Jav ]
 
Maki Jav
Ranch Hand
Posts: 449
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello there, Any answers?
Should I tranfer it to some other forum like Java (Advance)?

Thanx

Maki Jav
 
Adeel Ansari
Ranch Hand
Posts: 2874
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
database might be slower in performance if there is
- small no of records.

but if multiple type of records then you have to maintain more than one file. and in case of huge no of records.

- you dont have indices in your file for searching
- performance depends on your search mechanism

if talk about relationships between the entities then again database is better to implement relationships.

infact it depends upon the need. we have different kind of JDBC drivers to connect with database. they also discuss performance issues. you have to choose the driver best suits your app.

wait for some more comments. you will have some definitely, just have patience.
 
Maki Jav
Ranch Hand
Posts: 449
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you Adeel for your comments. My recoed are not more than 15000. And no indexing, complex queries against data are required.

Well, I will wait for more comments to come.

By the way, is the writer really serious in "How To Write Unmaintainable Code " ???


Maki Jav
[ December 14, 2004: Message edited by: Maki Jav ]
 
Adeel Ansari
Ranch Hand
Posts: 2874
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Not sure.
But its more about how the visitors take it.
if seriously
 
steve souza
Ranch Hand
Posts: 862
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I would go with the database. Once your program becomes more complex such as when you want to have transactions, add tables, your table becomes bigger than available memory, you want to do point queries then you will quickly see how powerful a database is.
 
Maki Jav
Ranch Hand
Posts: 449
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes Steve. I agree to that... but what you say if the records are expected to be around 15000 and no complex queries are made. Thanks for informing me of the benefits databases carry.

The fdsapi seems be to a good choice for rendering data into html and xml.

There is another useful api Java DBGrid. Check it out too.

Maki Jav
[ December 20, 2004: Message edited by: Maki Jav ]
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!