online bookstore database csc 8490 by: chaya gaddamanugu ramaselvi bala subhashini rangu sheela...

31
ONLINE BOOKSTORE DATABASE CSC 8490 BY: Chaya Gaddamanugu Ramaselvi Bala Subhashini Rangu Sheela Anand

Upload: alan-golden

Post on 24-Dec-2015

215 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: ONLINE BOOKSTORE DATABASE CSC 8490 BY: Chaya Gaddamanugu Ramaselvi Bala Subhashini Rangu Sheela Anand

ONLINE BOOKSTORE

DATABASE

CSC 8490

BY: Chaya Gaddamanugu

Ramaselvi Bala

Subhashini Rangu

Sheela Anand

Page 2: ONLINE BOOKSTORE DATABASE CSC 8490 BY: Chaya Gaddamanugu Ramaselvi Bala Subhashini Rangu Sheela Anand

SSSR.COM

Application overview:

• The business model for this project is an "http://153.104.204.169:8080/books.html" that allows customers to buy books from their homes through a web site.

• The bookstore maintains a web site that allows people to search through all the books currently available through the store. The web site also provides a way for new customers to sign up, as well as existing customers to view their account status and order information.

Page 3: ONLINE BOOKSTORE DATABASE CSC 8490 BY: Chaya Gaddamanugu Ramaselvi Bala Subhashini Rangu Sheela Anand

. Application Requirements:

• Product Description: Detailed descriptions of all its books. This includes details such as title, author, price, category, and other information that helps the bookstore organize its collection, and helps the members search for a book.

• Customer Information: Data on every customer member. This includes information such as name, password, address, and other details that enable the business corporation to contact, bill, and deliver books to the members.

Page 4: ONLINE BOOKSTORE DATABASE CSC 8490 BY: Chaya Gaddamanugu Ramaselvi Bala Subhashini Rangu Sheela Anand

Functionality of the web site

• Searching and Browsing: Visitors must be able to search for books based on various attributes (e.g. title, category/subject). They must also be able to browse through the book collection without doing a specific search.

• Transactions: Customers must be able to easily select books to buy and check out. They also need to be able to view their account status, find out which books they currently have ordered and the order status information.

Page 5: ONLINE BOOKSTORE DATABASE CSC 8490 BY: Chaya Gaddamanugu Ramaselvi Bala Subhashini Rangu Sheela Anand

IMPLEMENTATION TOOLS

• ORACLE 9i– new features in Oracle 9i are its support for XML, Java

and C++. – Oracle9i continues to offer the best development

platform for Internet and traditional application development. Key focus areas include:

• XML

• Enterprise Java Engine

• SQL and PL/SQL improvements

Page 6: ONLINE BOOKSTORE DATABASE CSC 8490 BY: Chaya Gaddamanugu Ramaselvi Bala Subhashini Rangu Sheela Anand

IMPLEMENTATION TOOLS

• XML

• XSL

• JAVA

• TOMCAT SERVER

• HTML

• SQL

Page 7: ONLINE BOOKSTORE DATABASE CSC 8490 BY: Chaya Gaddamanugu Ramaselvi Bala Subhashini Rangu Sheela Anand

DESIGN PHASES

• PHASE I

– Design and create a database that organizes and stores data about the books, customers, and orders. This includes creating tables to store data, and designing rules for how these tables relate to each other so that the data they store can be combined in meaningful ways. Also includes conceptual design model, logical mapping and physical implementation.

Page 8: ONLINE BOOKSTORE DATABASE CSC 8490 BY: Chaya Gaddamanugu Ramaselvi Bala Subhashini Rangu Sheela Anand

PHASE II

• Writing Java code that implements an interface to the database.

• To establish a connection to the oracle 9i through java, the listener should run. This can be run from lnsctrl.exe.

• The entire jar files used here need to have their classpaths set.

• Developing java servlet, which takes in requests from the user and process it accordingly.

• The result is displayed with proper format using xml and xsl.

Page 9: ONLINE BOOKSTORE DATABASE CSC 8490 BY: Chaya Gaddamanugu Ramaselvi Bala Subhashini Rangu Sheela Anand

PHASE III

• Developing an html page for user login and books browsing and searching.

Page 10: ONLINE BOOKSTORE DATABASE CSC 8490 BY: Chaya Gaddamanugu Ramaselvi Bala Subhashini Rangu Sheela Anand

PHASE I

Page 11: ONLINE BOOKSTORE DATABASE CSC 8490 BY: Chaya Gaddamanugu Ramaselvi Bala Subhashini Rangu Sheela Anand

BUSINESS RULES

• Each book must be one and only one among a textbook or a general book or a magazine or a novel.

• Each textbook must be one and only one book.• Each generalbook must be one and only one book.• Each magazine must be one and only one book.• Each novel must be one and only one book.• Each textbook may be available as one and only one

newbook.• Each textbook may be available as one and only one oldbook.• Each newbook must be associated with one and only one

textbook. 

Page 12: ONLINE BOOKSTORE DATABASE CSC 8490 BY: Chaya Gaddamanugu Ramaselvi Bala Subhashini Rangu Sheela Anand

BUSINESS RULES

• Each oldbook must be associated with one and only one textbook.

• Each customer may have one or more order-info.

• Each order-info must be associated with one and only one customer.

• Each order-info must be a book order of one or more books.

• Each book must be a book order of one or more order-infos.

Page 13: ONLINE BOOKSTORE DATABASE CSC 8490 BY: Chaya Gaddamanugu Ramaselvi Bala Subhashini Rangu Sheela Anand

SPECIALIZATION

• The EER diagram is a result of specialization(top down approach)

• The books database consists of different disjoint categories, each having a common set of attributes apart from its own set of attributes.

• This is the basis of specialization, resulting in – BOOKS as super class entity, TEXTBOOKS,

GENERALBOOKS, MAGAZINES AND NOVELS its subclass entities.

• Created a relation for each superclass and subclass with the Primary Key of the superclass as Primary Key of each subclass.

Page 14: ONLINE BOOKSTORE DATABASE CSC 8490 BY: Chaya Gaddamanugu Ramaselvi Bala Subhashini Rangu Sheela Anand

AVOIDING NULL VALUES

TEXTBOOKS TEXTBOOKS NEWBOOKS OLDBOOK ISBN ISBN ISBN ISBN SUBJECT SUBJECT NEWPRICE OLDPRICE TITLE TITLE NEWCOPIES OLDCOPIES AUTHOR AUTHOR CO_AUTH CO_AUTH PUBLICAT PUBLICAT EDITION EDITION PAGES PAGES BOOK_CD BOOK_CD DESC DESC DATE DATE NEWPRICE NEWCOPIES OLDPRICE OLDCOPIES

Page 15: ONLINE BOOKSTORE DATABASE CSC 8490 BY: Chaya Gaddamanugu Ramaselvi Bala Subhashini Rangu Sheela Anand

EER DIAGRAM

books

book_order info

order_info

d

textbooks

generalbooks magazines novels

available

available

newbook oldbook

cust_info

Account-order info

m

n

m

1

11

11

Page 16: ONLINE BOOKSTORE DATABASE CSC 8490 BY: Chaya Gaddamanugu Ramaselvi Bala Subhashini Rangu Sheela Anand

MAPPING with CARDINALITY AND PARTICIPATION

Page 17: ONLINE BOOKSTORE DATABASE CSC 8490 BY: Chaya Gaddamanugu Ramaselvi Bala Subhashini Rangu Sheela Anand

PHASE II

Page 18: ONLINE BOOKSTORE DATABASE CSC 8490 BY: Chaya Gaddamanugu Ramaselvi Bala Subhashini Rangu Sheela Anand

DIRECTORY STRUCTURE

textbooksstyle.xsl

magstyle.xsl

BIN novelstyle.xsl

generalstyle.xsl

textbooks.xml

magazines.xml

TOMCAT novels.xml

BooksGen1.class

CLASSES

FinalGen1.class

LIB All jar files

books.html

WEBAPPS ROOT

records.html

Page 19: ONLINE BOOKSTORE DATABASE CSC 8490 BY: Chaya Gaddamanugu Ramaselvi Bala Subhashini Rangu Sheela Anand

PHASE II

• Servlet – captures user input from the browser – establishes connection with the database – processes the request – generates an XML file – applies an XSL stylesheet and outputs a HTML file.

• Establishing connection to the database try {

DriverManager.registerDriver(new oracle.jdbc.driver.OracleDriver()); con = DriverManager.getConnection(conStr, user,password); }

• Use appropriate query to get data from the database.– qryStr = "select * from textbooks t, newbook nb where t.isbn=nb.isbn";– qryStr = "select * from magazines";– if((topic.equals("Subject-Category")) &&

(category.equals("Textbooks"))){qryStr = "select distinct * from textbooks t, newbook nb where subject like '%" + keyword +

"%' and t.isbn=nb.isbn";keyword is what the customer enters.

  

Page 20: ONLINE BOOKSTORE DATABASE CSC 8490 BY: Chaya Gaddamanugu Ramaselvi Bala Subhashini Rangu Sheela Anand

PHASE II

• converts the data got from the database to an XML file, and save it in the bin directory of the server.

• The generated XML file and the stylesheet for the XML file are combined to form an HTML file.

• This HTML file is stored in the ROOT directory of the server.

• This file is the result of search.

Page 21: ONLINE BOOKSTORE DATABASE CSC 8490 BY: Chaya Gaddamanugu Ramaselvi Bala Subhashini Rangu Sheela Anand

A BRIEFING OF XML

• RESULT OF A NORMAL QUERY

TITLE FNAME LNAME ISBN PUBLISHER

Oracle9i XML handbook Ben Chang 123456 oracle press

Page 22: ONLINE BOOKSTORE DATABASE CSC 8490 BY: Chaya Gaddamanugu Ramaselvi Bala Subhashini Rangu Sheela Anand

XML

• Result in XML format

<book>

<title>Oracle9i XML handbook</title> <author>

<fname>Ben</fname><lname>Chang</lname>

</author><isbn>123456</isbn><publisher>oracle press</publisher>

</book>

Page 23: ONLINE BOOKSTORE DATABASE CSC 8490 BY: Chaya Gaddamanugu Ramaselvi Bala Subhashini Rangu Sheela Anand

XSL STYLESHEETS

<?xml version="1.0"?>

<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

<xsl:template match="/">

<html>

<head><title>Search Results</title></head>

<body bgcolor="#FFCDAE">

<table border="0" cellspacing="7" cellpadding="1">

<xsl:for-each select="ROWSET/ROW">

<tr><th>TITLE</th><td><xsl:value-of select=“TITLE" /></td></tr>

<tr><th>ISBN</th><td><xsl:value-of select=“ISBN" /></td></tr>

</xsl:for-each>

</table>

</body>

</html>

</xsl:template>

</xsl:stylesheet>

Page 24: ONLINE BOOKSTORE DATABASE CSC 8490 BY: Chaya Gaddamanugu Ramaselvi Bala Subhashini Rangu Sheela Anand

FINAL HTML FILE

Page 25: ONLINE BOOKSTORE DATABASE CSC 8490 BY: Chaya Gaddamanugu Ramaselvi Bala Subhashini Rangu Sheela Anand

PHASE III

Page 26: ONLINE BOOKSTORE DATABASE CSC 8490 BY: Chaya Gaddamanugu Ramaselvi Bala Subhashini Rangu Sheela Anand

PHASE III

• Develop an html file, books.html, which will be the front end of the web site.

• An html file for user authentication.

• And a final, system generated html file, that is the result of the search.

Page 27: ONLINE BOOKSTORE DATABASE CSC 8490 BY: Chaya Gaddamanugu Ramaselvi Bala Subhashini Rangu Sheela Anand

EXECUTION:

• Load the database.

• Start the database server (lsnrctl.exe).

• Start the Tomcat web server.

• Access the website

http://153.104.204.169:8080/books.html

from the browser. 

• Begin search and transactions.

Page 28: ONLINE BOOKSTORE DATABASE CSC 8490 BY: Chaya Gaddamanugu Ramaselvi Bala Subhashini Rangu Sheela Anand

DEMO

Page 29: ONLINE BOOKSTORE DATABASE CSC 8490 BY: Chaya Gaddamanugu Ramaselvi Bala Subhashini Rangu Sheela Anand

EXTENSIONS:

• The project can be extended to a major B2B (Business To Business) application. The system would store detailed information about the products available, client information and the administrative side details.

• What is a B2B Application?– A B2B application is a web application that helps organizations

streamline processes, such as manufacturing and distribution, so they can do business more efficiently with their resellers and suppliers. It gives them a faster way to compare prices and availability of goods and services they need to buy. And it's an excellent way to show global customers what they have to offer.

Page 30: ONLINE BOOKSTORE DATABASE CSC 8490 BY: Chaya Gaddamanugu Ramaselvi Bala Subhashini Rangu Sheela Anand

XML AND CROSS-PLATFORM COMPATABILITY

• Different enterprises can have their data in different formats.

• Data exchange requires a high level of technological agreement about data types, structures etc.

• Since XML is in text form and is self-describing, it allows companies to integrate applications across the internet.

Page 31: ONLINE BOOKSTORE DATABASE CSC 8490 BY: Chaya Gaddamanugu Ramaselvi Bala Subhashini Rangu Sheela Anand

SUMMARY AND LESSONS LEARNT

• The project helped us understand the functionality of a web-based e-commerce application.

• We are now able to comprehend the role played by newer technologies in improving such applications.

• We now understand how to integrate Oracle 9i, XML and Java for the implementation of such an application. We also understand the importance of a web server.  

• It was a pleasant experience doing the project!