Implementing the E Commerce Database Interface Solution

by Dan Herman.

Share
|
Homepage | Submit your article | Contact | TOS
More articles on web services  

You are here: Categories » Internet » Web services

The primary function of a Web server is to send appropriate HTML code to the Web browser. Today’s trend is to serve content to the Web via an e-commerce database solution. In order to make this happen, the Web server must communicate with the database. The Web server must make requests to the database, interpret the database’s response, and pass on the appropriate data to the Web browser.

In order for the Web server to communicate with a database, it must communicate through an Application Programming Interface (API). There are many different types of database access APIs available for the developer—ranging from proprietary to open standard APIs. A Web database developer has many options from which he can select the API that best meets the requirements of the project. However, the developer must be very careful in the selection of the API if he must support a heterogeneous environment. One API might not support all database or Web servers in the developer’s environment.

Embedded SQL

In the early days of relational databases, the only portable interface for applications was Embedded Structured Query Language (SQL). There was no common function API and no standard Fourth Generation Language (4GL). Embedded SQL uses a language-specific Precompiler. SQL commands are embedded in a host programming language, such as C or COBOL. The Precompiler translates the embedded commands into host language statements that use the native API of the database.

The problem with using Embedded SQL is that there must be a compiled version of the database interface for each database and operating system supported. This is not efficient or useful for heterogeneous environments. Also, the developer may run into problems with each database vendor’s C API. Not all database APIs are created equal.

ODBC

When building a Web site that must connect to many different databases, the first database connectivity standard normally considered is Open Database Connectivity (ODBC). ODBC is a logical choice, because it is a standardized API. It is a set of function calls based on the SQL Access Group (SAG) function set for utilizing an SQL database system (backend system). The SAG set implements the basic functionality of Dynamic SQL. Embedded SQL commands can be translated to call ODBC. Finally, there are ODBC drivers for every major database application.

Applications access ODBC functions through the ODBC Driver Manager, which dynamically links to the appropriate ODBC driver. ODBC drivers translate ODBC requests to native format for a specific data source. The data source may be a complete RDBMS, such as FirstSQL, or it may be a simple file format, such as Xbase. In other words, most ODBC drivers are tied to a single data source. Some, like FirstSQL, support multiple data sources. The FirstSQL ODBC driver supports both a FirstSQL data source and an Xbase data source.

Though its name begins with open, implying that it is not tied to a single vendor or even to a subset of RDBMS vendors, ODBC is controlled by a single vendor: Microsoft. Microsoft defines the specification of the API and supplies the basic driver manager software used on their operating systems. This control has some good aspects and some bad for the future of ODBC.

Microsoft has made reasonable, useful extensions to the original SAG definitions in creating ODBC. Later releases have refined those extensions. Microsoft has committed to bringing future versions of ODBC more in line with SAG’s specifications and with existing standards.

OLE DB

In a major strike against ODBC, Microsoft is touting their Object Linking and Embedding Data Base (OLE DB) facility as a replacement for ODBC. OLE DB could be viewed as an object layer placed on top of ODBC, but Microsoft is likely to provide direct OLE DB drivers for their database products and to de-emphasize and perhaps discontinue ODBC drivers for their products. OLE DB is not open or portable except between Microsoft operating systems (OSs), which is now a single Windows OS NT.

Because of Microsoft’s total control of the specification and arbitrary complexities in the facility, OLE DB will not be supported by other operating systems—Operating System 2 (OS/2), Macintosh Operating System (MAC OS), and various flavors of Unix. ODBC, and Embedded SQL to a lesser degree, will remain as the only open and portable interfaces for SQL accessible databases. Unfortunately, the fate of ODBC is completely under the control of Microsoft.

Java and JDBC

Java Database Connectivity (JDBC) is an SQL-level API that allows you to embed SQL statements as arguments to methods in JDBC interfaces. To allow you to do this in a database-independent fashion, JDBC requires database vendors to furnish a runtime implementation of its interfaces. These implementations route your SQL calls to the database in the proprietary fashion it recognizes. As the programmer, though, you do not ever have to worry about how JDBC is routing SQL statements. With JDBC, you can run the same code no matter what database is present. A Java client/server application can make use of one of the following three major database architectures:

  • Object database

  • Object-relational database

  • Relational database

The majority of today’s databases are relational databases. Thus, the JDBC API is heavily biased to relational databases and SQL. There is an architectural conflict between Java and relational databases. Java is object-oriented, whereas relational databases are not object-oriented. Therefore, mapping between the Java objects to the SQL relationship must occur. It is up to the developer to do this mapping.

The use of Java and JDBC has two distinct advantages for heterogeneous Web application development. It is database independent and facilitates distributed computing. A Java database application does not care what database engine is used. Therefore, the developer can change the database engine without having to change the Java application. In fact, the developer can write a class library that maps business objects to database entities in such a way that the application does not know that a database is in use.

Using Java for distributed computing has the advantage that the user can download the Java code as he needs it. The administrator does not have to install the software on each user’s workstation. This model is very beneficial when it comes time to update the application. The administrator does not have to reinstall software.

DBI-PERL

Practical Extraction and Reporting Language (PERL) is most likely the most common scripting language used on the Web today. It is predominantly used with the Uniplexed Information and Computing System (Unix) operating system, even though it can be used with Windows NT®. PERL is well-suited for the Web because it is a language that was written to handle text and text files. The PERL community also needed an interface to databases. Because PERL is an open source application, the Database Interface (DBI) is perfect for this task.

Note

DBI for the Perl Language is defined as the Database Interface language (DBIl) API specification set of functions, variables, and conventions that provide a consistent database interface independent of the actual database being used.

In simple language, the DBI interface allows users to access multiple database types transparently. So, if you are connecting to an Oracle, Informix, mSQL, Sybase, or whatever database, you don’t need to know the underlying mechanics of the 4GL layer. The API defined by DBI will work on all of these database types.

A similar benefit is gained by the ability to connect to two different databases of different vendors within the one PERL script (if you want to read data from an Oracle database and insert it back into an Informix database all within one program). The DBI layer allows you to do this simply and powerfully.

Leave a comment or ask a question
Total comments: 0

Web services Disclaimer

  • The e-articles directory is not responsible for any and all copyright infringements by writers and authors. If you suspect the information contained by this page for any copyright infringements, please contact us to investigate the issue
SQL Server Hosting :: MSSQL Vs MySQL - I know it is hard to decide between SQL Server Hosting and MySQL hosting. Which is better? Which is more reliable? Which offers more features? These are just a few questions when it comes to SQL Se (more...)
Windows Hosting :: An overview - Are you wondering why Windows hosting is better than Linux hosting? If you ask 10 people what they think, 5 will say that Windows hosting is the best, while the other 5 will say that Linux hosting (more...)
ASP Hosting :: Why Do People Still Use Classic ASP - Did you notice that many people are still using ASP? This is somewhat strange due to the popularity of.NET. Why are they still using the classic instead of the new and powerful ASP.NET? First of al (more...)
Windows Reseller Hosting :: Competition Point of View - Did you ever wonder what reseller hosting really is? It is basically a form of web hosting in which the owner of the account is using his or her bandwidth and hard disk space to host third party we (more...)
ASP.NET 4.0 Hosting :: The New ASP Net Technology Improvements - ASP.NET 4 brings a lot of new possibilities over its predecessor, ASP.NET 3. One of the best additions is support for meta keywords and meta description. These are very important parts of a website (more...)
How to get paid to write answers online - There are many Q&A websites out there such as Yahoo Questions, Answers.com and Blurtit.com. The basis of these websites is simple, a user goes to one of these sites, types a question and lets o (more...)
What is Hosting and Types of Hosting - Hosting is one of those core Internet concept that starts out easy and gets insanely confusing as you delve into it.Every website is 'hosted' somewhere.In other words, the 'hosting' entity runs a m (more...)
Social Networking Development can Enhance your Business - We have all heard about social networking websites but there are only a few who really knows what it means. Social networking can be defined as a grouping by some individuals together into specifi (more...)
Do You Really Need Dedicated Server Hosting (q) - If you own a business, you are always thinking of expanding it to increase your revenue. Various business proprietors are looking to expand their business online to grow their market. You may requi (more...)
Guide for a good dedicated hosting - You might have heard of servers that are dedicated for each website but you might not know what they are. If you ant to know more things about that, then you should know more things about the dedic (more...)

 
free content
    Copyright © 2006 - 2012 e-articles.info.
The texts, articles and tutorials in the directory are property of their respective owners and authors.