28 May 2013

Learn How Databases Are Accessed On The Web??

In general, we can't connect a remote user's web browser directly to a database system. There are exceptions to this-java applets are one way around it. The browser talks to a program running on the web server that is an intermediate to the database. This program is CGI ( Common Gateway Interface) script, a java servlet or some code written inside an ASP or JSP document. The program retrieves the information from the database and sends it to the user as HTML pages. The following  figure shows the interaction between a user and a web-based database system:-

  1.   The user types in a URL or fills a form or submits a search a search on a web page.
  2.  The browser sends the user's query from the browser to the web server, which passes it on to a CGI  script. CGI is a predefined system for transferring data across the Internet.
  3. The CGI Script converts the query into SQL commands and sends to the Database server.
  4. The database server executes the SQL commands passes the results to the CGI Script.
  5. The CGI Script generates an HTML document and sends it to the web server.
  6. The web server sends the HTML document to the user.
If the user had sent some information to update a database, then the CGI Script will generate the appropriate SQL commands and send it to the database server. The database server will execute the commands and then send the result to the user.
E.g :-  An example of an insert operation will be filling up a form on your browser to so online registration  for exam. Another  example for an update operation will be updating your profile on Facebook.

No comments:

Post a Comment