• Post Reply Bookmark Topic Watch Topic
  • New Topic

What's faster than JSP?

 
dee_philipp
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm relatively new to JAVA.
What would be faster than JSP (JAVA Server Pages) when it comes to reading data from and posting data to a database?
My team members swear by JSP, but refreshing web pages to update information seems to take so long and cause a lot of frustration on behalf of our users.
>> Is there another way of accessing our database (Oracle via SQL) without "screwing up" everyone else's work on the project?
(I come from the scripting world, and know a lot about DHTML, JavaScript, and that kind of stuff...but when it comes to JAVA, I'm really still an infant.)
Thanks much for any information anyone of you more experienced cowgals or cowboys might have.
 
Marius Holm
Ranch Hand
Posts: 84
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
All solutions rely on all of the components in that system. I don't know much about JSP except from encounters on the web, but they seem reasonably performing to me. I've done some ASP, the MS version of JSP (the original, to be just towards MS, they get so much shit elsewhere ) and with MS components all the way (IIS on a NT/Win2000) it performs excellent. What webserver do you use? What kind of Object do you use to access the DB? SQL, you say? Where does JDBC come into play? Well, I can't help you on this, but I think others would need more info as well.
Regards,
Marius
 
Ajith Kallambella
Sheriff
Posts: 5782
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Your name "dee_philipp" does not comply with the JavaRanch naming policy. Please choose one that meets the requirements.
Without an accptable name, you will not qualify for JavaRanch free giveaways!, so its worth the try
Ajith
 
Brett Knapik
Ranch Hand
Posts: 255
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I heard that PHP can generate 48 pages by the time jsp can generate 30 or something like that.
------------------
I wish there was a button on my monitor to turn up the intellegince.
Theres a button called 'brightness' but it doesn't work
 
Mirko Froehlich
Ranch Hand
Posts: 114
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If implemented correctly, accessing a database via JSP should not really be slow. In fact, it does not even matter whether you are doing this (I assume you are using JDBC) from a JSP page, a Java Servlet, or some other Java code. Behind the scenes, JSP pages are compiled into Servlets, so they should perform the same. If database access seems really slow, you might be doing something wrong. For example, you might be opening a new connection every time you hit the database, which is an expensive operation. If this is the case, try implementing a connection pool class, which should tremendously speed things up.
On a side note, doing all this in your JSP pages is not really considered good style, even though everybody has their own preferences. In general, it makes sense to move most of the Java code into Java Beans or Servlets, and let the JSP pages mainly deal with presentation logic.
-Mirko

Originally posted by dee_philipp:
I'm relatively new to JAVA.
What would be faster than JSP (JAVA Server Pages) when it comes to reading data from and posting data to a database?
My team members swear by JSP, but refreshing web pages to update information seems to take so long and cause a lot of frustration on behalf of our users.
>> Is there another way of accessing our database (Oracle via SQL) without "screwing up" everyone else's work on the project?
(I come from the scripting world, and know a lot about DHTML, JavaScript, and that kind of stuff...but when it comes to JAVA, I'm really still an infant.)
Thanks much for any information anyone of you more experienced cowgals or cowboys might have.

 
Colin Chow
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
actually Mirko brought up a good point. It really depends on how you design your architecture. In general, you should have the underlying classes that takes care of the database connection pool, instead of opening a new connection database every time the page gets hit. Bringing up and down a connection is pretty resource intensive. Also jsp is generally slower than servlet. Why? It's because when you write jsp, you basically rely on the jsp compiler/parser in your application server to convert it to a servlet. How good this parser really varies from vendor to vendor. Plus, in servlet, since you have more control on how things are implemented (like recycling objects, caching "hot" data), you can speed things up accordingly. But in jsp, you just don't have this flexibility on your hand. Again, you are replying on the jsp parser to do this for you. This is another case of convenience versus performance.
Hope this help.
Colin
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!