Databases Reference
In-Depth Information
SQLJ runtime (as well as to additional profile files). The Java source code is then
compiled, and the application is run with the SQLJ runtime library.
SQLJ and JDBC can be mixed in the same program when some SQL is static and other
SQL is dynamic.
Oracle features a tightly integrated Java Virtual Machine and support for Java stored
procedures in the Oracle database; these enable component-based development to take
place through the use of JavaBeans. Java Messaging Support (JMS) is provided through
Oracle Streams when deployed in the database.
The Oracle database can act as a Web Services consumer or provider and can be ex‐
posed using JPublisher, Oracle's utility for generating Java classes that represent user-
defined database entities. Web services capabilities in the Oracle database include SQL,
PL/SQL, embedded Java, JDBC, HTTP client, and SOAP client, and are combined with
those in Oracle Application Server (Java, J2EE, JDBC, HTTP, SOAP server, and XML).
The latest releases of the APEX Listener and Oracle Application Express also support
the easy creation and use of RESTful Web Services, which are described in more detail
in Chapter 15 .
As of Oracle Database 11 g , the database can be treated as a service provider in a service-
oriented architecture (SOA) environment using the XDB HTTP Server for SOA.
PL/SQL packages, procedures, and functions can be exposed as Web Services. Dynamic
SQL and XQuery queries can be executed when deploying the database in this manner.
JavaBeans
Java software components are referred to as JavaBeans (and sometimes referred to as
Enterprise JavaBeans or EJBs when server-side). JavaBeans can be deployed in the Ora‐
cle database server or in the Oracle Fusion Middleware application server. The Java
Virtual Machine in the database makes use of Oracle System Global Area (SGA) mem‐
ory management capabilities to provide JavaBeans scalability beyond what would be
expected in most JVM implementations. For example, each client within the JVM re‐
quires only about 50-150 KB of memory for session state.
Oracle8 i introduced the session bean to the database, created by a specific call from the
client and usually existing only during a single client/server session. Session beans may
be stateless , allowing the server to reuse instances of the bean to service clients, or stateful
(i.e., bound to clients directly). Database cache information maintained by stateful ses‐
sion beans is synchronized with the database when transactions occur by using JDBC
or SQLJ. Entity Java beans , also known as persistent beans (because they remained in
existence through multiple sessions), were introduced in Oracle9 i but were later re‐
placed by Java persistence API entities. Today, the other type of bean available is the
message-driven bean , designed to receive asynchronous Java Message Services (JMS)
messages and supported via Oracle's more recent Applications Servers.
Search WWH ::




Custom Search