You are previewing JDBC 4.0 and Oracle JDeveloper for J2EE Development.
O'Reilly logo
JDBC 4.0 and Oracle JDeveloper for J2EE Development

Book Description

In Detail Data retrieval and storage is one of the most common components of J2EE applications. JDBC (Java Database Connectivity) is the Java API for accessing a SQL relational database and adding, retrieving, and updating data in the database. Oracle JDeveloper is a developer-friendly integrated development environment (IDE) for building service-oriented applications using the latest industry standards for Java, XML, web services, and SQL. It supports the complete development lifecycle with integrated features for modeling, coding, debugging, testing, profiling, tuning, and deploying applications. This book is about developing Java/J2EE applications with a database component in Oracle JDeveloper (version 10.1.3). It covers the practical aspects of JDBC (version 4.0); it will teach application developers about setting the environment for developing various JDBC-based J2EE applications and the procedure to develop JDBC-based J2EE applications. It will also explore the new features added in JDBC 4.0. What you will learn from this book? In this book you will learn about the following:

  • JDBC 4.0 specifications--including the new features

  • Configuring JDBC in Oracle JDeveloper IDE

  • Creating, modifying, and querying a database with the JSTL SQL Tag Library

  • Configuring JDBC in JBoss application server, WebLogic server, and WebSphere application server

  • Mapping an XML document to a database table and vice versa

  • Modifying a database table from an XML document and creating an XSQL Page to run an SQL Query and generate XML

  • Implementing Oracle Web RowSet to fetch the disconnected data

  • Creating Excel spreadsheets, PDFs, and Excel reports using JasperReports and the Apache POI HSSF library

  • Creating JSF Data Tables, JSF Panel Grids, and business components from Oracle databases with JDeveloper

  • Creating and managing database tables using Hibernate

Approach Being a quick reference guide, this book has a focused approach. You will learn to develop J2EE applications with JDBC and JDeveloper in no time. The book covers lot of practical examples, which makes it developer-friendly learning material. Who this book is written for? The book is suitable for Java/J2EE and Oracle JDeveloper beginners. If you are a J2EE developer and want to use the JDeveloper IDE for J2EE development, this book is for you. JDeveloper developers who are new to J2EE will also benefit from the book. Most J2EE applications have a database component and the book is specially suited for database-based J2EE development in Oracle JDeveloper. You can also use this book if you are interested in learning how to utilize the new features offered in JDBC 4.0 for Java/J2EE development.

Table of Contents

  1. JDBC 4.0 and Oracle JDeveloper for J2EE Development
  2. Credits
  3. About the Author
  4. About the Reviewer
  5. Preface
    1. What This Book Covers
    2. Who is This Book for
    3. Conventions
    4. Reader Feedback
    5. Customer Support
      1. Downloading the Example Code for the Book
      2. Errata
      3. Questions
  6. 1. JDBC 4.0
    1. DriverManager Class
    2. Connection Interface
    3. Transactions
    4. Savepoint Interface
    5. Statement Interface
    6. ResultSet Interface
    7. PreparedStatement Interface
    8. Database Metadata
    9. JDBC Exceptions
    10. New Features in JDBC 4.0
      1. Automatic SQL Driver Loading
      2. Enhanced Data Type Support
      3. SQL: 2003 XML Data Type Support
        1. Generating an XML Document
        2. Storing an XML Document
        3. Retrieving an XML Document
        4. Accessing an XML Document Data
      4. Support for Wrapper Pattern
        1. Enhancements in SQLException
        2. Connection Management
        3. Scalar Functions
      5. JDBC 4.0 support in Oracle Database
      6. JDBC 4.0 support in MySQL Database
      7. JDBC 4.0 support in IBM's DB2 UDB
    11. Example Connection using a JDBC 4.0 Driver
    12. Summary
  7. 2. Configuring JDBC in Oracle JDeveloper
    1. Connection Pooling and DataSource
    2. Setting the Environment
    3. JDBC Configuration Errors
    4. Creating a Managed Data Source
    5. Connecting to a Database from a Web Application
      1. Setting J2SE Version to JDK 6.0
      2. Developing and Running JSP
    6. JDBC 4.0 Version
    7. Summary
  8. 3. Connecting to a Database with JSTL SQL Tag Library
    1. Overview of JSTL SQL and Core Tags
    2. Setting the Environment
    3. Creating a Database Table
    4. Updating a Database Table
    5. Querying a Database Table
    6. Summary
  9. 4. Configuring JDBC in JBoss Application Server
    1. Deploying a Web Application to JBoss from JDeveloper
      1. JDBC 4.0 Version
    2. JBoss Deployment Descriptors for EJBs
    3. Configuring JBoss Server with Oracle Database
    4. Configuring JBoss Server with MySQL Database
    5. Configuring JBoss Server with PostgreSQL Database
    6. Configuring JBoss Server with DB2 Database
    7. Configuring JBoss Server with SQL Server
    8. Summary
  10. 5. Configuring JDBC in WebLogic Server
    1. Setting the Environment
    2. Creating a Data Source
    3. Configuring a Data Source
    4. Creating a Multi Data Source
    5. Performance Tuning JDBC
    6. Deploying a Web Application to WebLogic Server from JDeveloper
    7. JDBC 4.0 Version
    8. Summary
  11. 6. Configuring JDBC in WebSphere Application Server
    1. Setting the Environment
    2. Configuring a JDBC Provider
    3. Configuring a Data Source
    4. Deploying a Web Application to the WebSphere from JDeveloper
    5. JDBC 4.0 Version
    6. Summary
  12. 7. XML SQL Utility
    1. Setting the Environment
    2. XML Document to SQL Database Mapping
    3. Updating Database from XML Document
    4. Deleting a Row in a Database
    5. SQL Database to XML Document Mapping
    6. Summary
  13. 8. XSQL
    1. Overview of XSQL Tags
    2. Setting the Environment
    3. Configuring a Connection
    4. Creating XSQL Queries
    5. Applying XSQL Query Attributes
    6. Transforming XSQL Output
    7. JDBC 4.0 Version
    8. Summary
  14. 9. Oracle Web RowSet
    1. Setting the Environment
    2. Creating a Web RowSet
    3. Modifying a Database Table with Web RowSet
    4. Creating a New Row
    5. Reading a Row
    6. Updating a Row
    7. Deleting a Row
    8. Updating Database Table
    9. JDBC 4.0 Version
    10. Summary
  15. 10. Creating a JSF Data Table
    1. Setting the Environment
    2. Creating a Data Table by Binding a MBean
    3. Creating a Data Table with the JSF API
    4. JDBC 4.0 Version
    5. Summary
  16. 11. Creating a JSF Panel Grid
    1. Setting the Environment
    2. Creating a Panel Grid by Binding Rows
    3. Creating a Panel Grid by Binding a Managed Bean
    4. JDBC 4.0 Version
    5. Summary
  17. 12. Creating a Report with JasperReports
    1. Setting the Environment
    2. Installing JasperReports
    3. Configuring the JasperReports Configuration File
    4. Generating a PDF Report
    5. Creating an Excel Spreadsheet
    6. JDBC 4.0 Version
    7. Summary
  18. 13. Creating a Spreadsheet with Apache POI
    1. Setting the Environment
    2. Creating an Excel Spreadsheet
    3. JDBC 4.0 Version
    4. Summary
  19. 14. Creating Oracle ADF Business Components
    1. Setting the Environment
    2. Configuring a BC4J Project
    3. Creating Business Components
    4. Developing a BC4J Web Application
    5. JDBC 4.0 Version
    6. Summary
  20. 15. Hibernate
    1. Hibernate and JDBC
    2. Setting the Environment
    3. Developing Hibernate Mapping and Properties Files
    4. Creating a Database Table
    5. Modifying Table Data with Hibernate
    6. Adding Data to the Database Table
    7. Retrieving Data from the Database Table
    8. Updating the Database Table
    9. Deleting Data
    10. Summary