Sapere On Line - basic courses, professional and advanced

LINUX

     Is Linux Really FREE?
     Getting Linux
     So What Do I Gain?
     What Do I Lose?
     Getting a Free Copy
     Dual Booting
Preserving Your Data
Windows on Linux
Getting Ready for Your Installation
Hardware Considerations
Dual Booting Revisited
An Installation Comparison
A Mandrake Linux Install
Putting On The Red Hat
Rambler's 

Top100

 

Linux

Introduction to Java
Database Programming

Earlier chapters have discussed the merits of the Oracle architecture and its ability to effectively
store, protect, and manipulate data for a large number of users. While Oracle provides many tools
to help populate and extract data from this store, a key requirement for developers is support of
flexible, programmatic access to this data.
Oracle already supports many programming languages through its precompiler technology and
other language interfaces (for example, COBOL, C, perl), so one could question why Java deserves
special treatment. While discussions about the merits of one programming language versus another
often degenerate into a fruitless debate, it is fair to open this discussion with two broad reasons in
favor of Java:
? Java finally opens the door to standards-based, portable applications that can be written
once and easily deployed on multiple databases or platforms. Open standards encourage
innovation as vendors compete to differentiate in their implementation of the standards.
? Java is beyond just being a programming language—it is supplemented with the J2EE
framework to provide a reusable component-based architecture.
Oracle has an impressive track record supporting open standards, and Java is a shining example.
This chapter introduces some of the fundamentals of the Java architecture and benefits of Oracle’s
wide support for it in different development scenarios.
The first section runs through Java architecture basics. It briefly explains some of the language constructs,
terminology, and common issues associated with Java and database programming. It is followed by
a section describing Oracle’s support for Java in a multi-tier architecture, which describes Oracle’s
JDBC support and models of Java programming against the database. The last section walks you
through some concrete examples of Java database programming in an Oracle environment.Java Architecture
Java has become a programming language of choice, as indicated by its rapid adoption by developer
communities, educational institutions, and software vendors. More than just a programming language,
Java is a platform that offers all the pieces needed to build complete applications, from the user interface
to server-side business logic to data manipulation. This section provides a basic understanding of Java’s
architecture and some of the underlying terminology in context of database programming. It should be a
familiar refresher to experienced Java programmers and is not intended to be a primer for object-oriented
programming or basic Java language syntax.
Java: The Language
A programming language by itself is not the most significant factor in the building of efficient, error-free,
reusable software systems. Java is no exception, but it does have some strong characteristics that contribute
toward these goals.
First, Java is an object-oriented language, so the language naturally supports the following:
? Encapsulation. The ability to keep an object’s data and methods that use the data together as
part of the object
? Inheritance. The ability to take existing object-oriented code and easily extend its capability
without code modification
? Polymorphism. The ability for all objects within an inheritance hierarchy to respond to a single
request but with different implementation methods (or business rules)
Java borrows from the language syntax of C and C++ but reduces the complexity associated with these
languages by providing a strong type-based system as well as managing storage and garbage collection
for the developer. In essence, Java provides the power of object-oriented programming yet makes it easier,
safer, and more productive to use than C or C++.
Java Virtual Machine and Bytecode
Java source code must be compiled before execution. Compiling the code converts it from text into binary
bytecode, which is the instruction set that is understood by a Java Virtual Machine (JVM). Bytecode is
portable across platforms, so it is not even necessary to recompile Java code when deploying on a different
operating system, as illustrated in Figure 18-1.
At the heart of Java is the Virtual Machine. It is an abstract computer implemented in software that executes
the bytecode. Defining the specification of a virtual machine and then implementing it on multiple
platforms gives Java its cross-platform portability and many of its security and safety capabilities. Today
there are JVM implementations on Win32, Mac OS, zOS (mainframe), Unix, and Linux flavors.In addition to portability, the virtual machine simplifies the storage and creation of objects during runtime.
This includes creating and allocating memory structures for arrays and new instances of objects. When
the objects are no longer used, they are periodically cleaned up by a garbage collector within the VM. The
VM approach provides a well bounded “sandbox” within which applications can safely execute. Over (a
long enough period of) time, the VM ensures that there are no memory leaks and the sandbox is in a state
of equilibrium. A sandboxed VM is ideal for server-side applications in a multithreaded environment,
since it reduces the impact and occurrence of common programming errors (for example, accessing an
array out of bounds or referencing a pointer in another application’s memory space).
What about Performance?
Efficient memory management, garbage collection, and platform-independent interpreted bytecode are
all positive attributes of Java. They are also the same reasons for claims about poor performance with the
language. It’s true this was an issue with early versions of the JVM. However, thanks to industry momentum,
Java has made tremendous gains in improving relative performance over natively compiled languages.
Ajust-in-time (JIT) compiler is the default in most JVM implementations today. Depending on its implementation,
most JITs would compile a method or class at a time into native code, as required, for faster execution.
As of Java 1.2 and above, the reference implementation has included Hot Spot—a combination of JIT with a
dynamic profiler to identity exactly when (point in time) and what (usage or code pattern) makes it most
appropriate for the VM to bear the cost of compiling just in time. Vendors such as Oracle have also gone the
extra step of providing native compilers for Java on their platform. Anative compiler optionally compiles
bytecode down to machine code for a particular platform—a one-time, predeployment operation that can
provide a significant boost in runtime performance.
Given these improvements, there are numerous large-scale production Java sites and benchmarks that
would show that Java is well established in mission-critical applications and performs equally to if not
better than C/C++ in most conditions.
 


ORACLE

Oracle Data Dictionary
Installing Oracle
Introduction to SQL
Extended SQL
Indexes
Constraints
Other Database Structures
Functions
Distributed Queries, Transactions, and Databases
PL/SQL Basics
PL/SQL and SQL
PL/SQL Packages
Introduction to Java Database Programming
Triggers
Regular Expressions and Expression Filter
Object Relational Interactions with Oracle
Oracle XML DB
HTML-DB
High-Speed Data Movement
Data Loading and Management
Business Intelligence Query
Business Intelligence Analysis
Optimization
© 2008 The Company, Inc. All rights reserved. Terms of Use and Disclaimer


-