• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

JSP, tomcat, database

 
chure abcede
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Hi folks,

I'm new to JSP and I just started learning this for a week and I still don't have a wide overview of how JSP works.
I'm aware that JSP is the same with PHP only that JSP uses java technology. My question is,if php uses myphpadmin for the database, so what is it in JSP and what really are the functions of this server like tomcat which the one I used.

I would really appreciate all of your comments.

Thanks you.
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64718
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
JSP is for views only. Database access is not done in a JSP, but in Java class, preferably in the Model layer of an application using the MVC pattern.

Java classes use JDBC to access database.

For an overview of what JSP is all about, see this article.
 
deepak veyan
Greenhorn
Posts: 10
Java MySQL Database Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

JSP forms the view part of your MVC architecture.You could be using any database as per your preference. PHPMyAdmin is just a tool to access your database (MySQL). Probably you must have installed a WAMP package where in all the required materials came bundled.Coming to JSP , you can still continue using MySQL database if you prefer to.

Tomcat is an application server and acts as your JSP container.It compiles your JSP files into class (servlets) files and make them available to accept requests and serve responses.

Hope that helped !
 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13058
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You really should get a strong grounding in servlets, the servlet life cycle, and the servlet API before even touching a JSP page. Otherwise you will just flounder around with mysterious errors.

Bill
 
chure abcede
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks everyone for the help.Somehow it gives me a little overview on how this things work.

@deepack- Are there any good database available other than MySql that is best suited for big websites(i really mean a huge website). You mentioned that PhpMyAdmin is just a tool which great because atleast now I know, I'm still a little bit of confuse if what tool should be use to access the database in JSP.

@William Brogden- thanks for the tips anyways,it would really help me, and this servlets also is new programming term to me same with jsp.

@bear-thanks for the link.it really helped me.
 
margaret gillon
Ranch Hand
Posts: 335
6
Linux Tomcat Server Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Postgresql is a great database for large web sites. It is open source, runs on most platforms, is ACID compliant, and scales well. There is a large support maillist for Postgresql and J2EE on the Postgresql site and you can get support for Postgresql here in the Javaranch JDBC forum. Javaranch runs on the Postgresql database.
 
deepak veyan
Greenhorn
Posts: 10
Java MySQL Database Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you have the budget to go for Oracle , I guess that should be the best.You can leverage the power of PL SQL code to house your business logic within the database as well.This helps you build a really robust MVC application.Otherwise you will find lot many like even MySQL should be a good choice according to me.
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64718
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
deepak veyan wrote:I guess that should be the best.

You guess? Could you outline while you feel that Oracle would be a better choice than PostgreSQL or even MySQL/MariaDB?
 
deepak veyan
Greenhorn
Posts: 10
Java MySQL Database Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Moreover , do you have any special reasons to not use MySQL.? (just out of curiosity) . To connect the database you could use a JDBC driver and make a connection within the page , but that would be the last thing I would suggest. You can write a servlet class and write the code there too.

The only tool you would require is jdbc drivers , which can be easily found as JARs.
 
chure abcede
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
MYSql is not a problem to me, its that i'm just curios if there's another good database other than MySql which is good for web. Ill consider Postgresql in the list and I'm still learning JSP now.
 
Hussein Baghdadi
clojure forum advocate
Bartender
Posts: 3479
Clojure Mac Objective C
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
PostgreSQL is the Oracle DB in the open source realm and doesn't shines only for large system. You can use it from small systems to very large, sharded ones.
I'm not -of course- advocating against MySQL or any other RDBMS but PostgreSQL is really a vital option. The documentation is extensive and detailed; I never find a need to buy a book. And the knowledge pool is massive.
 
deepak veyan
Greenhorn
Posts: 10
Java MySQL Database Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Bear Bibeault wrote:
deepak veyan wrote:I guess that should be the best.

You guess? Could you outline while you feel that Oracle would be a better choice than PostgreSQL or even MySQL/MariaDB?


In the little experience I had , I could see awesome capabilities of PL SQL in Oracle making it support a robust MVC architecture. Meanwhile , I have just started working with MySQL database and found that it does not support returning UDTs from database stored procedures(Kindly correct me if I am wrong).I haven't really worked on PostgresSQL yet.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic