| By Jonathan Bruce | Article Rating: |
|
| November 29, 2005 03:45 PM EST | Reads: |
13,695 |
Although EJB 3.0 provides a standard set of interfaces, the configuration for each implementation will likely vary to some degree. In the following example, we look at how Oracle's EJB 3.0 implementation is configured with the DataDirect Connect for JDBC driver for the Oracle database.
You can obtain a copy of Oracle's 10.1.3 J2EE Container (OC4J) from www.oracle.com/technology/software/products/ias/preview.html, and the DataDirect Connect for JDBC Driver for the Oracle database from www.datadirect.com/products/jdbc/index.ssp. Then, copy the driver JAR files to this location:
cp 'base.jar utils.jar and oracle.jar'
$ORACLE_HOME/j2ee/home/applib
Next, create a DataSource in data-sources.xml located in the following directory:
$ORACLE_HOME/j2ee/home/config
For an Oracle database, configure the DataDirect driver as a managed data source:
<managed-data-source
name="OracleDataSource"
jndi-name="jdbc/DDOracleDS"
description="Managed DataSource">
connection-pool-name="myConnectionPool"/>
Include the following data that defines a connection pool.
<connection-pool
name="myConnectionPool"
min-connections="10"
max-connections="30"
inactivity-timeout="30">
<connection-factory
factory-class="com.ddtek.jdbcx.oracle.OracleDataSource"
user="scott"
password="tiger"
url="jdbc:datadirect:oracle://<HOST>:1521"/>
</connection-factory>
</connection-pool>
Persistence Mechanisms - Comparison
Having discussed the various backgrounds of today's market-leading O/R mapping mechanisms, there are many considerations that you need to keep in mind when making your choice. Table 1 summarizes the key technical, business, and support capabilities that you will want to consider when choosing a Persistence framework.
JDBC - The Critical Link
O/R technologies excel at providing an object-oriented view of relational data while eliminating the development effort relating to the persistence model. Since the O/R mapping mechanisms generate efficient JDBC calls to access the database, some people argue that the relative importance of the JDBC driver has been reduced. But, as with any architecture, the overall efficiency of the application will be greatly affected by the weakest layer in the application stack. Regardless of the JDBC code that is generated, the O/R mapping mechanisms lack the ability to control how the drivers interact with the database. At the end of the day, the efficiency of the application is in large part dependent on the ability of the JDBC driver to securely move data between the application and the database with the greatest level of performance, scalability, and reliability. The ability of the driver to efficiently communicate with the wire-level protocol exposed by the database and to efficiently manage packet transmission as it relates to fetching data and performing updates is fundamental to the application. Although there are many factors to consider when selecting a JDBC driver (interoperability, standards leadership, technical support, etc.), selecting the best possible JDBC driver based on performance, scalability, and reliability is key to realizing the benefits of applications that are based on an O/R framework.
Conclusion
O/R mapping mechanisms offer a compelling model for many developers looking to overcome the impedance mismatch associated with object and relational data constructs. O/R technologies improve developer productivity by eliminating the development effort associated with managing persistence, allowing the developer to focus on the application's business logic. Although there are many factors to consider when selecting an O/R technology, the recent trend to reconcile the O/R mapping APIs should prove beneficial to all development organizations. While some organizations are motivated by the developer productivity gains associated with using an O/R mapping mechanism, it is extremely important to the overall success of the application to leverage best-of-breed components at each layer in the architecture stack. Leveraging an industry-leading JDBC driver that provides the performance, scalability, reliability, and security that is necessary in today's applications is critical to the overall success of the O/R infrastructure.
Published November 29, 2005 Reads 13,695
Copyright © 2005 SYS-CON Media, Inc. — All Rights Reserved.
Syndicated stories and blog feeds, all rights reserved by the author.
More Stories By Jonathan Bruce
Jonathan Bruce is program manager at DataDirect Technologies. He has led and participated in four JSRs and enjoys helping Java and .NET developers take advantage of the benefits XQuery offers when working with XML and a variety of databases. Recently relocated from San Fransisco to North Carolina, Jonathan spends his weekends running, sailing, and traveling.
![]() |
Tony Walker 11/16/05 09:40:15 AM EST | |||
Not a bad article, but it's a pity you didn't include JDO and some of the newer ideas like db4o and Persistent Java Objects in the evaluation. JDO is a standards-based direct competitor to Hibernate, with many implementations to choose from. Persistent Java Objects is a new system well suited to RAD. It requires no mapping, and so is very fast to implement and easy to modify. |
||||
![]() |
JDJ News Desk 11/01/05 03:53:17 PM EST | |||
JDBC -The Indispensable Component of Persistence Mechanisms. Few serious database applications are considered enterprise-worthy without a core database engine backed by a normalized and optimized relational database architecture. Traditionally, such database applications rely on SQL statements to retrieve and update data in the back-end data source. |
||||
- Kindle 2 vs Nook
- Why IBM’s Server Chief Got Busted
- Is Cloud Computing Like Teenage Sex?
- Industry Experts Discuss the State of Cloud Computing
- Performance Tuning Essentials for Java
- Confessions of a Ulitzer Addict
- Tactical Cloud Computing Panel at 1st Annual GovIT Expo
- It's the Java vs. C++ Shootout Revisited!
- Cloud Computing Can Revitalize Your Career as Software Developer
- IBM Could "Reinvent" Java: Mills
- Oracle & Cloud Computing: Exclusive Q&A with SVP Richard Sarwal
- A Brief History of Cloud Computing
- Kindle 2 vs Nook
- Cloud CEOs, CTOs & SVPs to Speak at 4th International Cloud Computing Expo
- Why IBM’s Server Chief Got Busted
- Is Cloud Computing Like Teenage Sex?
- Industry Experts Discuss the State of Cloud Computing
- Performance Tuning Essentials for Java
- The Difference Between Web Hosting and Cloud Computing
- Cloud Computing Expo: Exclusive Q&A with Yahoo! SVP Cloud Computing
- Ajax in RichFaces 3.3, JSF 2 and RichFaces 4
- Confessions of a Ulitzer Addict
- My Thoughts on Ulitzer
- Tactical Cloud Computing Panel at 1st Annual GovIT Expo
- A Cup of AJAX? Nay, Just Regular Java Please
- Java Developer's Journal Exclusive: 2006 "JDJ Editors' Choice" Awards
- The i-Technology Right Stuff
- JavaServer Faces (JSF) vs Struts
- Rich Internet Applications with Adobe Flex 2 and Java
- Java vs C++ "Shootout" Revisited
- Bean-Managed Persistence Using a Proxy List
- Reporting Made Easy with JasperReports and Hibernate
- Creating a Pet Store Application with JavaServer Faces, Spring, and Hibernate
- What's New in Eclipse?
- Why Do 'Cool Kids' Choose Ruby or PHP to Build Websites Instead of Java?
- i-Technology Predictions for 2007: Where's It All Headed?

































