reduce your costs and extend your database with java in ... · low cost platform integration ......

13
Reduce your Costs and Extend your Database with Java in the Oracle Database An Oracle White Paper November 2003

Upload: phamhanh

Post on 29-Apr-2018

219 views

Category:

Documents


2 download

TRANSCRIPT

Reduce your Costs and Extend your Database with Java in the Oracle Database An Oracle White Paper November 2003

Reduce your Costs and Extend your Database with Java in the Oracle Database

Executive Overview.............................................................................. 3 Reduce your costs with Java in the Database ....................................... 3

Cost Reduction.................................................................................. 3 Faster and Low Cost Java Applications Development ................. 3 Faster Application Deployment and Execution ............................ 4 Low Cost PLatform Integration .................................................... 5

Risk Reduction.................................................................................. 5 Choice ........................................................................................... 5 Secure and Reliable Java Execution ............................................. 6

Extending the Reach of your Database............................................. 6 Extending the Reach of your Database......................................... 6 Open and Secure Extensibility of Database Capabilities.............. 6

Extend your database with Java in the Database – the tecsis case study6 Conclusion ............................................................................................ 6

Reduce your Costs and Extend your Database with Java in the Oracle Database Page 2

Reduce your Costs and Extend your Database with Java in the Oracle Database

EXECUTIVE OVERVIEW Since Oracle8i, the Oracle Database furnishes a built-in, scalable, Java VM (OracleJVM) for running Java stored procedures, as well as standard and third-party J2SE, JDBC, JMS, and JAI libraries, that implement data logic and/or persistence logic, closer to the data, directly in the database. With Oracle Database 10g, we’ve pushed the envelope further. The first part of this paper gives an overview of new Java features of Oracle Database 10g, that will help reduce your costs, reduce the risks and extends the capabilities of your Oracle database. The second part describes the TECSIS case study which illustrates how the company reduced its costs by implementing an easy-to-use framework to integrate their platform comprising PL/SQL Stored Procedures, SAP R3, Natural/Adabas, RPG/DB400, COBOL Tandem, COM Components, and non-Oracle databases (Adabas-D, MSSQL Server) using OracleJVM to the best of its capacity.

REDUCE YOUR COSTS WITH JAVA IN THE DATABASE In this new database release, we’ve upgraded the Java engine to J2SE 1.4.x, improved the integration of Java with SQL, PL/SQL, XML, J2EE and Web services – as an example, a pure Java SOAP client libraries turns your database into a Web service consumer -- we’ve optimized Java memory management, Java class loading, and Java pool adjustment; we’ve also re-designed the servers-side JDBC driver for faster in-session SQL data access. These enhancements result in cost reduction, risk reduction and extension of the reach of your database.

Cost Reduction How exactly does Java in the database help reduces application development, deployment and execution costs?

Faster and Low Cost Java Applications Development

Main enhancements in J2SE 1.4 include new logging mechanisms (JSR-041), mandatory security libraries (JAAS, JCE), preferences (JSR-010), assertions (JSR-041), exception chaining, new scalable IO (JSR-051), headless AWT and

Reduce your Costs and Extend your Database with Java in the Oracle Database Page 3

regular expression (java.util.regex). Upgrading OracleJVM to J2SE 1.4.x allows reusing a larger, up-to-date, set of Java library directly in the database, thereby reducing development costs and cycle. The ability to reuse existing Java skills to build custom libraries or reuse existing libraries, also results in faster and lower cost database applications development. In addition, the new Native Java Interface allows direct Java-to-Java invocation without the need to furnish a PL/SQL wrapper, eliminating the necessity of manually creating PL/SQL wrapper known as “call-spec”. In addition, the JPublisher utility has been extended to publish more database functionality such as SQL Query, SQL DML as well as Java classes in the database to J2EE and Web Service. These enhancements simplify the integration of the database with Java and Web Services worlds, and contribute to the reduction of overall application development time and costs.

Faster Application Deployment and Execution

The new bytecode verifier in LoadJava utility accelerates application loading and deployment to the database. The complete re-architecture of the new server-side JDBC driver and optimizations to Java memory management when using dedicated servers (see Figure 2 Java Memory Areas) result in faster, in-session SQL data access -- simple function call in same memory space -- and faster J2SE, JDBC, SQLJ, JMS and JAI applications execution, in the database.

Reduce your Costs and Extend your Database with Java in the Oracle Database Page 4

Low Cost Platform Integration

See the TECSIS case study, later in this paper, on the implementation of a custom, low cost, integration framework, using OracleJVM.

Figure 2 Java Memory areas

Risk Reduction

Choice

With Java in the database, Oracle customers have the choice of database programming language – Java or PL/SQL -- the pros & cons are out of the scope of this paper. The support for the latest Java standards including, J2SE 1.4.x, JDBC 3.0, JAI 1.0, JMS 1.x, JAX-RPC client enables the partitioning of J2SE, JDBC, JMS and JAI applications across the middle-tier/J2EE and the Database tier, which gives customer the choice in terms of deployment architecture. In addition, the new Native Java Interface allows the choice of alternative invocation modes for Java in the database: either directly from Java/J2EE, or via the traditional PL/SQL wrapper. Finally and similarly to PL/SQL, Java stored procedures can now propagate all SQL exceptions back to the caller, making Java a perfect alternative.

Reduce your Costs and Extend your Database with Java in the Oracle Database Page 5

Secure and Reliable Java Execution

In addition to its proper security mechanisms1, OracleJVM also supports the new standard and required J2SE 1.4.x security features such as Java GSS-API, JAAS, JCE, and JSSE resulting in a safer Java execution environment, less vulnerable to malicious Java code, unlike traditional JDKs. See JSSE support with HTTP Call-out using Oracle8i and Oracle9i in the Java in the Database at Work 2 white paper.

Extending the Reach of your Database

Extending the Reach of your Database

This release offers the first production delivery of Database Web Services (see related paper). The ability to invoke database operations through Web Services mechanisms (SOAP, WSDL)3, extends the client-base of your Oracle database to non-connected client, and heterogeneous environments. Similarly the ability to consume, federate, and aggregate data from J2EE and Web Services, using HTTP call-out to JSP/Servlets, direct RMI/IIOP EJB call-out, and SOAP client for Web Services call-out, extends the outreach of the database to dynamic/on-demand data.

Open and Secure Extensibility of Database Capabilities

The ability to load and run standard, third party, or custom Java libraries, such as pure Java RPC libraries to outreach external ERP/legacy systems, and pure Java JDBC drivers to outreach non-Oracle databases, offers an open mechanism to extend the capabilities of the database, as illustrated by the TECSIS case study, hereafter. Loading a pure java SOAP library turns your database into a Web Services consumer; similarly, loading standard JSSE libaries allows secure HTTP call-out from within pre-10g databases such as Oracle8i and Oracle9i – JSSE is now required in J2SE 1.4.x, therefore integrated in Oracle Database 10g. The integration of Java with the SQL engine allows the exposure of the new capabilities to SQL and PL/SQL as well. OracleJVM security mechanisms allow defining, restricting and fine-tuning the scope, the privileges, and the visibility of the loaded libraries.

EXTEND YOUR DATABASE WITH JAVA – THE TECSIS CASE STUDY In this section, you will learn how TECSIS (TENARIS group) reduced its costs by implementing an easy-to-use enterprise-class framework, to integrate different platforms, including Oracle PL/SQL stored procedures, SAP R3, Natural/Adabas, RPG/DB400, COBOL Tandem, COM Components, and non-

1 http://otn.oracle.com/oramag/oracle/03-jul/o43devjvm.html 2 http://otn.oracle.com/tech/java/jsp/pdf/JavaDB_Use_Case.pdf 3 http://www.sys-con.com/webservices/articleprint.cfm?id=515

Reduce your Costs and Extend your Database with Java in the Oracle Database Page 6

Oracle databases (Adabas-D, MSSQL Server) using OracleJVM to the best of its capacity.

About the Company Tenaris, the world leader in tubular technologies, represents eight established manufacturers of steel tubes: AlgomaTubes, Confab, Dalmine, NKKTubes, Siat, Siderca, Tamsa, and Tavsa. With a combined production capacity of 3,000,000 tons of seamless and 850,000 tons of welded steel tubes, annual sales of $3 billion, and 13,000 employees in five continents, Tenaris is a leading supplier of tubular goods and services to the global energy and mechanical industries. Our market share is about 30 percent of world trade in OCTG seamless products and 13 percent of total world seamless tube production. The main goal of Tecsis, the System Technology division of Tenaris, is to validate and disseminate technology throughout the companies within the Tenaris group. This section describes our experience of using Java in the Oracle database and how it solved our integration requirements.

About the Application Tenaris has been using Oracle database for three years. We started by implementing the business rules, using PL/SQL Stored Procedures, which gave us many advantages. With the Java virtual machine embedded in the database (OracleJVM), we extended the capabilities of our database and turned it into a data integration hub.

Business and Technical Requirements

Business Requirements

Our business requirements made it necessary to integrate online information from different platforms, including: SAP, AS400, ADABAS/NATURAL, and COBOL Tandem. Our PL/SQL based business rules needed to send and get data from these platforms. Existing legacy systems, as well as new intranet/Internet-based development, required cross-platform integration. Our main goal was cost savings through reuse of software, systems, and skills.

Technical Requirements

We needed to integrate the following platforms: Oracle PL/SQL Stored Procedures, SAP R3, Natural/Adabas, RPG/DB400, COBOL Tandem, COM Components, and non-Oracle Databases (Adabas-D, MSSQL Server). Different RPC technologies to integrate legacy systems but we were not happy with their degree of integration. By that time, the need to reach information available online on other platforms, from existing PL/SQL packages, became crucial.

In summary, our most important requirements were:

1. Simplify cross-platform integration.

Reduce your Costs and Extend your Database with Java in the Oracle Database Page 7

2. Cost Savings: Instead of adding a new integration layer, we decided to leverage existing components and use each of these components to the best of its capacity

3. In addition, we wanted to avoid the explosion of communication that would be generated by point-2-point integration.

Design and Programming Choices We chose to leverage OracleJVM and its ability to run Java libraries in the database, because all existing ERP systems and non-Oracle databases furnish either a Java-based Remote Procedure Call (RPC) software or a pure Java JDBC driver that can be loaded into the OracleJVM. PL/SQL wrappers make these mechanisms available to the SQL world as Java stored procedures. Existing or new PL/SQL-based business rules can easily interact with other systems. By centralizing our business rules in the Oracle database, along with transformation rules and making the whole thing accessible by both Web clients and batch jobs, the Oracle database became our integration engine.

All our new systems are based on Web pages that call stored procedures, which access the business rules. Existing batch jobs, as well as client applications, share the same business rules. We have also been able to standardize the way in which we call the procedures, using XML-based IN and OUT parameters. These XML parameters are parsed or generated using Oracle XDK.

The fact that the system became operational in a few days, without costly retraining of our PL/SQL programmers, is the best illustration of the simplicity of the solution. In addition, the integration of batch jobs was accomplished through three-line SQL* Plus scripts. Using a traditional Enterprise Application Integration (EAI) product would have been more complex and expensive. Instead, employing Java in the database not only simplified our integration process, it saved us money.

Integration Framework Architecture

Typical Use Case Scenarios

We had three use cases. In the first, Code Validation, system A (COBOL Tandem) needs to check whether a specific code value exists in system B (Oracle Database). In the second, Pop-Up Lists, system A (AS400 screen) needs to display a list of values using content from system B (Natural Adabas). In the third case, Cross-Platform Modifications, a new product is added to system A (Oracle Database) and the same product also must be added to system B (Natural Adabas).

Reduce your Costs and Extend your Database with Java in the Oracle Database Page 8

Java Stored Procedures Calling External Systems We selected the Software AG EntireX Communicator (formerly EntireX broker) to make remote calls to Natural/Adabas programs (OS/390), RPG programs (AS400), and Tandem COBOL programs.

Although SAP Java connector (SAP JCO) is distributed as a JAR file, it is not 100% Java based because it uses several .sl (libraries). For security reasons, OracleJVM does not allow Java classes to use external .sl libraries (that is, JNI calls). We worked around this restriction by running the SAP JCO as an external RMI server. Doing this allows us to issue RMI calls to the SAP JCO from within Java stored procedures. We loaded third-party pure Java JDBC drivers into the database for interaction between Java stored procedures and non-Oracle databases. If we need to interact with a remote Oracle database, we can load Oracle’s pure Java JDBC driver, also known as thin JDBC, into the database.

Then we created standard PL/SQL wrappers, called EAI_PKG, for each loaded module to allow uniform invocation from the PL/SQL-based business rules. Finally, we distributed an application integration guide internally to all PL/SQL programmers. In a few days, they were able to build procedures that interact with other platforms. By centralizing the business rules, and adding integration and transformation rules, we created a complete data integration framework. These business, integration, and transformation rules all interact with external systems through Java stored procedures using the EAI_PKG. Our new system comprises a Web-based presentation layer, as well as batch jobs (SQL*PLUS scripts). We use Oracle Object for OLE (OO4O) to execute Oracle procedures from our presentation layer (.asp). Both the presentation layer and the batch jobs use this same integration framework.

Reduce your Costs and Extend your Database with Java in the Oracle Database Page 9

Although the concept of the Oracle Advanced Queuing system does not appear in Figure 1, the EAI_PKG furnishes a queue corresponding to every remote system. If a remote system is down or unreachable, the EAI_PKG package automatically enqueues the message in the corresponding queue. An internal DBMS_JOB job is associated with every queue and is scheduled to run at a determined frequency. This job dequeues the pending messages and attempts to process them until the target system becomes available.

Compared to Java stored procedures, traditional EAI products do not offer the same level of ease-of-use.

External Systems Calling Java Stored Procedures

Once we were able to call all our external systems from Java stored procedures, the next step was enabling external systems to call Java stored procedures. To accomplish this second step, we reused both the EntireX Communication and the SAP Java connector. Natural Adabas, AS400, and COBOL Tandem will place a call against EntireX, which, in turn, invokes a Java stored procedure. The response from the Java stored procedure is sent back to the legacy system.

Likewise, SAP/ABAP applications call the SAP Java connector, which, in turn, calls the Oracle stored procedure. The response from the stored procedure is returned to the ABAP application.

Reduce your Costs and Extend your Database with Java in the Oracle Database Page 10

Putting This All Together By using the Oracle database as a central point of communication, we enabled any system to talk to any other system, while avoiding point-to-point communication. The entire framework is monitored by an Oracle stored procedure that, at a determined frequency, performs a call to each target system as well as the EntireX and SAP connector. In case one of the monitored systems returns an error, the procedure sends a notification e-mail. Our next step will be to send SNMP traps to a central console. We are currently working on this.

Reduce your Costs and Extend your Database with Java in the Oracle Database Page 11

CONCLUSION Java enhancements in Oracle Database 10g include a J2SE 1.4.1 compatible Java VM, a re-engineered server-side JDBC, a Native Java Interface, optimized Java memory management for dedicated servers, SQL exception reporting and propagation, optimized Loadjava utility, automatic Java pool adjustment, new tracing capabilities, resulting in reduced costs, reduced risks, extended database reach and capabilities. TECSIS was able to leverage Java in the Oracle database to implement a complete, easy-to-use integration framework that extends and improves PL/SQL usage. By using Java in the Oracle database to its full capacity, they were able to turn the database into an online integration broker. In addition, they were able to shield their developers from the underlying complexity of their platform, thereby simplifying the integration process.

Combining Java strengths and openness with the power of a RDBMS and its SQL engine, turns the Oracle database into a powerful, open, fast, flexible, extensible and versatile data logic server.

Reduce your Costs and Extend your Database with Java in the Oracle Database Page 12

Reduce your Costs and Extend your Databasee with Java in the Oracle Database November 2003 Authors: Kuassi Mensah, Esteban Capoccetti Contributing Authors: Oracle Corporation World Headquarters 500 Oracle Parkway Redwood Shores, CA 94065 U.S.A. Worldwide Inquiries: Phone: +1.650.506.7000 Fax: +1.650.506.7200 www.oracle.com Oracle Corporation provides the software that powers the internet. Oracle is a registered trademark of Oracle Corporation. Various product and service names referenced herein may be trademarks of Oracle Corporation. All other product and service names mentioned may be trademarks of their respective owners. Copyright © 2002 Oracle Corporation All rights reserved.

Reduce your Costs and Extend your Database with Java in the Oracle Database