Chapter 15: Running SQL Using Java


In this chapter, you will

  • Learn the basics of running SQL using Java through the Java Database Connectivity (JDBC) Application Programming Interface (API); JDBC enables a Java program to access a database

  • Examine the various Oracle JDBC drivers that may be used to connect to an Oracle database

  • Perform SQL DML statements to retrieve, add, modify, and delete rows from database tables using Java

  • Learn how to use the various Java types to get and set column values in the database, including how to handle numbers and database NULL values using Java

  • Examine how to perform transaction control statements and SQL DDL statements

  • Handle database exceptions that may occur when your Java programs are run

  • Gain access to all of the data types supported by an Oracle database using Oracle s extensions to JDBC

    Note  

    This chapter gives an introduction to JDBC. For full details of using JDBC with an Oracle database, you should read my book Oracle9 i JDBC Programming (McGraw-Hill/Osborne, 2002).

Getting Started

Prior to running the examples in this chapter, you ll need to install a version of the Sun Microsystems Java Software Development Kit (SDK). You can download the SDK and view full installation instructions from Sun s Java web site at java.sun.com. This site also contains all the reference materials for Java and JDBC.

The directory where you installed the Oracle client software on your machine is called the ORACLE_HOME directory. This directory contains various subdirectories, one of which is the BIN directory, which contains the Oracle executable programs; another is the jdbc directory, which contains the following:

  • A text file named Readme.txt. You should open and read this file; it contains important information such as the latest installation requirements, which may have changed since this book was written.

  • A directory named doc, which has a Zip file that contains the Oracle JDBC API reference documentation.

  • A directory named demo, which has a Zip file that contains sample Java programs from Oracle.

  • A directory named lib, which contains a number of Zip and Java Archive (JAR) files.




Oracle Database 10g SQL
Oracle Database 10g SQL (Osborne ORACLE Press Series)
ISBN: 0072229810
EAN: 2147483647
Year: 2004
Pages: 217

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net