Brought to you by EarthWeb
ITKnowledge Logo Login Graphic Click Here!
Click Here!
ITKnowledge
Search this book:
 
Search the site:
 
EXPERT SEARCH ----- nav

EarthWeb Direct

EarthWeb Direct

EarthWeb sites: other sites

Previous Table of Contents Next


Part I
Introduction to Java Database Programming

Chapter 1: About Java

Chapter 2: Database Fundamentals

Chapter 3: Database

Part I presents general background information about Java. You’ll learn about typical applications related to Java and JDBC and why Java is so hot for client/server application development. You’ll then review some database fundamentals, including relational ones, the standards such as SQL, X/Open CLI, and ODBC, and client/server architectures involving DBMSs.

Finally, you’ll learn how to integrate today’s databases using various approaches, as well as with the state-of-the-art Java and JDBC.

Chapter 1
About Java

In This Chapter

Java is a new programming language especially well suited for the Internet. It offers many built-in features in its run time environment. From TCP-IP (Transmission Control Protocol/Internet Protocol) socket networking to method invocation on remote objects, from portable code and graphic toolkit to universal database connectivity, Java embraces many of the the technologies ever invented in the open-systems computing industry. This chapter covers:

  Java’s philosophy
  Typical uses of Java
  Java’s being more than a natural evolution

Java and its environment were introduced in 1995 by Sun Microsystems, Inc. Java was designed to meet the challenges of development in incompatible but networked environments.

Most modern programming languages already have some of the features present in Java, but none have all of the features. A majority of developers, analysts, designers, administrators, and executives agree that Java is the “enabler” of the 1990s. Much of the early discussion on the need for a Java-like language happened in Usenet newsgroups on the Internet. Now every major player endorses the technology and plans to deliver Java programs or javatized hardware. The reason is simple — Java’s features. Most of the features of Java and its environment are revealed in the next paragraphs; however, Table 1-1 summarizes Java’s feature set.

Table 1-1 JAVA — THE BIG PICTURE

Java C C++
Simple J K L
Object-oriented J L K
Robust J L L
Secure J L L
Interpreted J L L
Dynamic J L L
Portable J K K
Neutral J L L
Threads J L L
Garbage collection J L L
Exception J L K

J Fulfilled by the language
K Not built in the language, but feasible
L Not feasible in this language without third-party libraries

First and foremost, Java is definitely object-oriented. It is somewhat similar to C++, but its programming supplants functional and procedural styles. Java programmers only manipulate objects, data members, accessors, and mutators. Extra features such as automatic garbage collection (a garbage collector keeps track of the object instances and frees them when no longer used), object references replacing arithmetic address pointers, and native or nonnative multithreading add to Java’s simplicity and power.

Java is a true object-oriented programming language. It fully supports encapsulation, polymorphism, inheritance, and dynamic bindings. The main benefit for the programmer is that his or her programming model will be close to the real world objects, making them easier to implement. Software reuse also benefits from this orientation, as is the case, for example, with many well-known C++ libraries.

Java is architecture-neutral, portable, and robust in that it can run on various platforms, anywhere on a network, regardless of which graphic subsystem is in use. It is truly independent of hardware, operating systems, and GUIs. The design of the Java Virtual Machine and Java’s Abstract Window Toolkit make it portable, much more portable than C or C++, greatly simplifying deployment issues. This is why Java has such presence on the Internet. While Java applications are stand-alone programs, “applets” are pieces of software that can be downloaded from the Internet or intranet and run inside a World Wide Web (WWW) browser like HotJava. “Servlets” are also pieces of software that run as extensions to WWW servers while “aglets” are software agents that live and persist in networks, moving from host to host to perform dedicated tasks.

Java is an interpreted language whose bytecodes run within a secure virtual machine that translates the bytecodes to native CPU instructions. In some cases, this bytecode is compiled “just in time” and cached, or even “flash-compiled” so no additional interpretation is needed. It is also very dynamic. Java application classes may be downloaded across networks automatically.

Before passing to the interpreter for execution, bytecodes are verified. Bytecode verification ensures that the code does not point where it cannot point, that it does not violate access and network restrictions, and that it correctly accesses objects. Security is a very important intranet and Internet issue, which is why it is addressed at many levels of the Java environment.

Java provides an exception mechanism to create and catch user program errors and to catch system errors. This mechanism is superior to the usual way of trapping errors — using and testing return codes everywhere in the programs. It also adds to the code’s simplicity and readability, which decreases the risk of introducing errors into programs.

Finally, Java features multithreading in a manner that is mostly independent of the underlying operating system from a programmer’s point-of-view. Threads allow client-server applications to perform multiple tasks, including animations, concurrently.

Typical Uses

Many computer enthusiasts once said Java was well suited for animating World Wide Web pages. Actually, its use within WWW pages, mostly in the form of Java applets, is more a consequence of its design than its ultimate goal. Java is a very complete language, and there are no limitations that make it unsuitable for corporate and enterprisewide professional and business applications. On the other hand, both Sun and other parties are continuously enhancing the Java environment. These enhancements always preserve investments so there is no reason to wait before developing your next greatest corporate application in Java.


Previous Table of Contents Next
HomeAbout UsSearchSubscribeAdvertising InfoContact UsFAQs
Use of this site is subject to certain Terms & Conditions.
Copyright (c) 1996-1999 EarthWeb Inc. All rights reserved. Reproduction in whole or in part in any form or medium without express written permission of EarthWeb is prohibited. Read EarthWeb's privacy statement.