1 / 20

Basics of Web Databases

Basics of Web Databases. With the advent of Web database technology, Web pages are no longer static, but dynamic with connection to a back-end database. Web sites are now able to display updated information on-the-fly and support user interactivity.

harmon
Download Presentation

Basics of Web Databases

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Basics of Web Databases • With the advent of Web database technology, Web pages are no longer static, but dynamic with connection to a back-end database. • Web sites are now able to display updated information on-the-fly and support user interactivity. • One can use the same page to display information of thousands of products in a database.

  2. Three tiers of Web Databases • To build a Web database, usually we need to use a three-tier model: • Web server • Web application server (middleware), and • Database

  3. How a User Interacts with a Web Database • From a Web browser, a user submits a request to the Web server. • The Web server passes it onto the middleware • The middleware writes the request in SQL queries and sends it to a back-end database. • The data retrieved are handed back to the middleware

  4. How a User Interacts with a Web Database 5. The middleware generates a Web page for the data 6. The Web server sends the Web page to the browser 7. The browser displays the Web page to the user

  5. Web Database Connectivity • Web-database connectivity takes several different forms: • CGI scripting A custom application is developed using a traditional programming language (such as C++, Python, Perl, or Java) accessed through the Common Gateway Interface (CGI). • Application server Such as ColdFusion or ASP, which works with the Web server that can communicate with databases through ODBC

  6. ASP – Middleware for Windows Platform • ASP stands for Active Server Pages • ASP is a programming environment that gives the ability to generate dynamic html pages with the help of server side scripting. • VBScript is the default scripting language for ASP

  7. ASP – Middleware for Windows Platform • An ASP page is almost the same as a HTM or HTML page... the only difference is that an ASP page has the '.asp' extension • Active Server Page can include both client side and server side scripts. • In an ASP page VBScript is usually used as the server side and Java Script as the client side scripting language

  8. Special Software Needed to Write ASP? • You don't need any special software to write an ASP page. • An ASP page can be written with any HTML editor... even in Windows Notepad. • If you are looking for some special software to write an ASP page, Microsoft Visual InterDev is the best tool.

  9. Special Software Needed to Write ASP? • InterDev helps you to easily develop ASP applications because it simplifies the process of developing and debugging ASP applications • ASP is browser independent because all the scripting code runs on the server and the browser only gets a normal HTML page as a result of server side scripting.

  10. ASP Compatibility • ASP is an engine/program built into Internet Information Server (IIS) / Personal Web Server (PWS) • PWS is a smaller - but fully functional - version of IIS • To run IIS you must have Windows NT 4.0 or later • To run PWS you must have Windows 95 or later

  11. What is an ASP File? • An ASP file is just the same as an HTML file • An ASP file can contain text, HTML, XML, and scripts • Scripts in an ASP file are executed on the server • An ASP file has the file extension *.asp

  12. How Does it Work? • When a browser requests an HTML file, the server returns the file • When a browser requests an ASP file, IIS/ PWS passes the request to the ASP engine • The ASP engine reads the ASP file, line by line, and executes the scripts in the file • Finally, the ASP file is returned to the browser as plain HTML

  13. What Can be Done with ASP • Dynamically edit, change or add any content of a Web page • Respond to user queries or data submitted from HTML forms • Access any data or databases and return the results to a browser

  14. What Can be Done with ASP • The advantages of using ASP instead of CGI and Perl, are those of simplicity and speed • Provides security since your ASP code can not be viewed from the browser • Since ASP files are returned as plain HTML, they can be viewed in any browser

  15. A Sample ASP Script <HTML> <HEAD> <TITLE>Hello World</TITLE> </HEAD><BODY> <% ' This will print to the browser the  ' words Hello, ASP World. response.write "Hello, ASP World!" %> </BODY></HTML>

  16. ASP and Database Servers • To interact with a database, you usually have to add code that talks to a particular database using a proprietary language. • If you want your program to talk to an Access, FoxPro and Oracle databases you have to code your program with three different database languages.

  17. ASP and Database Servers • When programming to interact with ODBC you only need to talk the ODBC language. • The ODBC Manager will figure out how to contend with the type of database you are targeting • All that you need to do is have installed an ODBC driver that is specific to the type of database you will be using.

  18. ODBC/DSN • ODBC stands for Open Database Connection (or Connectivity).  • ODBC makes it easy to create ASP scripts that will connect to a database.  • Normally, each ODBC will have a DSN (Data Source Name).  • DSN contains all the information about the database

  19. Setting Up the DSN • Setting up the DSN is a simple process. • Simply double-click the ODBC in the Control Panel • Choose the System DSN tab, and click Add. Choose the type of database you'll be working with - the sample database is MS Access - then click finish. • You'll then need to type in the database name in the Data Source Name box, and click Select.

  20. Setting Up the DSN • Next you'll navigate to the drive and directory where the database is located, • Click on the file name and click OK on that window and the one behind it. • Now you can refer to the database by name in your scripts and the system will know which ODBC driver to use and where the database is located.

More Related