E-MARKETING E-ZONE PPT Using ADVANCED JAVA
-
Upload
sudhanshu-kumar-sah -
Category
Education
-
view
26 -
download
4
Transcript of E-MARKETING E-ZONE PPT Using ADVANCED JAVA
application
Based on J2EE
Why Use
E-Commerce
…….?
LOW ENTRY COST REDUCES TRANSACTION COSTSACCESS TO THE GLOBAL MARKET SECURE MARKET SHARE
SERVLET Used to create web application. Resides at server side and generates
dynamic web page. Extends capabilities of the servers and
respond to the incoming request.
ADVANTAGES OF SERVLET Overcome the disadvantages of CGI. Better Performance. Portability. Robust. Secure.
REQUESTDISPATCHER IN SERVLET The RequestDispatcher interface provides the
facility of dispatching the request to another resource it may be html, servlet or jsp.
getRequestDispatcher() method of ServletRequest returns the object of RequestDispatcher.
Example of using getRequestDispatcher method RequestDispatcher rd=request.getRequestDispatcher("servlet2"); //servlet2 is the url-pattern of the second servlet rd.forward(request, response);//method may be include or forward
JAVA SERVER PAGES(JSP)
Used to create web application just like Servlet technology.
A JSP page consists of HTML tags and JSP tags.
ADVANTAGE OF JSP OVER SERVLET
Extension to Servlet.
Easy to maintain.
Fast Development: No need to recompile and redeploy.
Less code than Servlet.
Needs no compilation.
CREATING A SIMPLE JSP PAGE
index.jsp
<html> <body> <% out.print(“Hello AOT”); %> </body> </html>
It will print Hello AOT on the browser.
GET AND POST
Features of GET requests are It can be bookmarked. It have length restrictions. It can be cached. It remains in the browser history.
Features of POST requests are This requests cannot be bookmarked. This requests have no restrictions on length of data. This requests are never cached. This requests do not remains in the browser history.
The doGet() Method :A GET request results from a normal request for a URL or from an HTML form that has no METHOD specified and it should be handled by doGet() method. public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { // Servlet code } The doPost() Method :A POST request results from an HTML form that specifically lists POST as the METHOD and it should be handled by doPost() method.public void do(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { // Servlet code }
JAVA DATABASE CONNECTIVITY
Why use JDBC?
Before JDBC, ODBC API was the database API to connect and execute query with the database. But, ODBC API uses ODBC driver which is written in C language (i.e. platform dependent and unsecured). That is why Java has defined its own API (JDBC API) that uses JDBC drivers (written in Java language).
Java JDBC is a java API to connect and execute query with the database. JDBC API uses jdbc drivers to connect with the database.
5 Steps to connect to the database in java
Register the driver class.
Creating conection.
Creating statement.
Executing queries.
Closing connection.
HOME PAGE
ADMIN LOGIN PAGE
DATA INPUT PAGE
INVALID ACCESS
CATALOG PAGE
PROS
No checkout queues
Reduce prices
You can shop anywhere in the world
Easy access 24 hours a day
Wide selection to cater for all consumers
CONS
Unable to examine products personally
Not everyone is connected to the Internet
There is the possibility of credit card number theft
On average only 1/9th of stock is available on the net
108- Sudhanshu Kumar Sah117- Swarup Kumar Ghosh119- Tarun Prasad