Making Oracle and JDBC Work For You



Similar documents
MAKING ORACLE AND SQLJ WORK FOR YOU John Jay King, King Training Resources

CS 377 Database Systems SQL Programming. Li Xiong Department of Mathematics and Computer Science Emory University

Java and Databases. COMP514 Distributed Information Systems. Java Database Connectivity. Standards and utilities. Java and Databases

JDBC (Java / SQL Programming) CS 377: Database Systems

Java DataBase Connectivity (JDBC)

Database Access from a Programming Language: Database Access from a Programming Language

Database Access from a Programming Language:

Self-test Database application programming with JDBC

SQL and Java. Database Systems Lecture 19 Natasha Alechina

The JAVA Way: JDBC and SQLJ

COSC344 Database Theory and Applications. Java and SQL. Lecture 12

Porting from Oracle to PostgreSQL

Chapter 9 Java and SQL. Wang Yang wyang@njnet.edu.cn

What is ODBC? Database Connectivity ODBC, JDBC and SQLJ. ODBC Architecture. More on ODBC. JDBC vs ODBC. What is JDBC?

Why Is This Important? Database Application Development. SQL in Application Code. Overview. SQL in Application Code (Contd.

Oracle8/ SQLJ Programming

Database Programming. Week *Some of the slides in this lecture are created by Prof. Ian Horrocks from University of Oxford

Java DB Performance. Olav Sandstå Sun Microsystems, Trondheim, Norway Submission ID: 860

JDBC. It is connected by the Native Module of dependent form of h/w like.dll or.so. ex) OCI driver for local connection to Oracle

Abstract. Introduction. Web Technology and Thin Clients. What s New in Java Version 1.1

CS346: Database Programming.

How To Use The Database In Jdbc.Com On A Microsoft Gdbdns.Com (Amd64) On A Pcode (Amd32) On An Ubuntu (Amd66) On Microsoft

1 SQL Data Types and Schemas

Overview. Database Application Development. SQL in Application Code (Contd.) SQL in Application Code. Embedded SQL. Embedded SQL: Variables

Java Programming with Oracle JDBC

Course Objectives. Database Applications. External applications. Course Objectives Interfacing. Mixing two worlds. Two approaches

High-Performance Oracle: Proven Methods for Achieving Optimum Performance and Availability

Database Application Development. Overview. SQL in Application Code. Chapter 6

Oracle to MySQL Migration

Accesssing External Databases From ILE RPG (with help from Java)

SQL and programming languages

DEVELOPING MULTITHREADED DATABASE APPLICATION USING JAVA TOOLS AND ORACLE DATABASE MANAGEMENT SYSTEM IN INTRANET ENVIRONMENT

CHAPTER 3. Relational Database Management System: Oracle. 3.1 COMPANY Database

NGASI AppServer Manager SaaS/ASP Hosting Automation for Cloud Computing Administrator and User Guide

CS/CE 2336 Computer Science II

More SQL: Assertions, Views, and Programming Techniques

An Introduction to SQL Injection Attacks for Oracle Developers. January 2004 INTEGRIGY. Mission Critical Applications Mission Critical Security

Package sjdbc. R topics documented: February 20, 2015

Services. Relational. Databases & JDBC. Today. Relational. Databases SQL JDBC. Next Time. Services. Relational. Databases & JDBC. Today.

FileMaker 11. ODBC and JDBC Guide

Developing SQL and PL/SQL with JDeveloper

Supplement IV.C: Tutorial for Oracle. For Introduction to Java Programming By Y. Daniel Liang

Developing Stored Procedures In Java TM. An Oracle Technical White Paper April 1999

Tuning Derby. Version Derby Document build: August 10, 2009, 1:04:58 PM (PDT)

Working With Derby. Version 10.2 Derby Document build: December 11, 2006, 7:06:09 AM (PST)

Database Access Through Java Technologies

TABLE OF CONTENTS...2 INTRODUCTION...3 APPLETS AND APPLICATIONS...3 JAVABEANS...4 EXCEPTION HANDLING...5 JAVA DATABASE CONNECTIVITY (JDBC)...

Microsoft SQL Server Features that can be used with the IBM i

Database Development OpenOffice.org & OOBasic

A basic create statement for a simple student table would look like the following.

Building Web Applications, Servlets, JSP and JDBC

Handling Exceptions. Copyright 2006, Oracle. All rights reserved. Oracle Database 10g: PL/SQL Fundamentals 8-1

Using the DataDirect Connect for JDBC Drivers with the Sun Java System Application Server

Generating XML from Relational Tables using ORACLE. by Selim Mimaroglu Supervisor: Betty O NeilO

2. Follow the installation directions and install the server on ccc

DATABASDESIGN FÖR INGENJÖRER - 1DL124

Enterprise Java. Where, How, When (and When Not) to Apply Java in Client/Server Business Environments. Jeffrey Savit Sean Wilcox Bhuvana Jayaraman

CACHÉ: FLEXIBLE, HIGH-PERFORMANCE PERSISTENCE FOR JAVA APPLICATIONS

D61830GC30. MySQL for Developers. Summary. Introduction. Prerequisites. At Course completion After completing this course, students will be able to:

Java Application Developer Certificate Program Competencies

Configuring Apache Derby for Performance and Durability Olav Sandstå

Chapter 13. Introduction to SQL Programming Techniques. Database Programming: Techniques and Issues. SQL Programming. Database applications

Version Overview. Business value

InterBase 6. Embedded SQL Guide. Borland/INPRISE. 100 Enterprise Way, Scotts Valley, CA

HP NonStop JDBC Type 4 Driver Performance Tuning Guide for Version 1.0

Evaluation. Copy. Evaluation Copy. Chapter 7: Using JDBC with Spring. 1) A Simpler Approach ) The JdbcTemplate. Class...

Crystal Reports XI. Overview. Contents. Understanding the CRConfig.xml File

Retrieving Data Using the SQL SELECT Statement. Copyright 2006, Oracle. All rights reserved.

CS2506 Operating Systems II Lab 8, 8 th Tue/03 /2011 Java API

Performance Tuning for the JDBC TM API

Embedding SQL in High Level Language Programs

LSINF1124 Projet de programmation

Oracle Database 10g: Program with PL/SQL

WHITE PAPER. An Introduction to SQL Injection Attacks for Oracle Developers

FileMaker 14. ODBC and JDBC Guide

Using DataDirect Connect for JDBC with Oracle Real Application Clusters (RAC)

1. Introduction What is Slice? Background Why Slice? Purpose of this Document Intended Audience...

Oracle Database: SQL and PL/SQL Fundamentals

Java and Microsoft Access SQL Tutorial

Supplement IV.D: Tutorial for MS Access. For Introduction to Java Programming By Y. Daniel Liang

Jaybird 2.1 JDBC driver. Java Programmer's Manual

Application Development A Cocktail of Java and MCP. MCP Guru Series Dan Meyer & Pramod Nair

Java MySQL Connector & Connection Pool

Performance Implications of Various Cursor Types in Microsoft SQL Server. By: Edward Whalen Performance Tuning Corporation

Embedded SQL programming

Oracle Database: SQL and PL/SQL Fundamentals

An Oracle White Paper June Migrating Applications and Databases with Oracle Database 12c

Spring Data JDBC Extensions Reference Documentation

Object Relational Mapping for Database Integration

Setting Up ALERE with Client/Server Data

Using Netbeans and the Derby Database for Projects Contents

Java 7 Recipes. Freddy Guime. vk» (,\['«** g!p#« Carl Dea. Josh Juneau. John O'Conner

INTEGRATING MICROSOFT DYNAMICS CRM WITH SIMEGO DS3

CA IDMS Server r17. Product Overview. Business Value. Delivery Approach

MyOra 3.0. User Guide. SQL Tool for Oracle. Jayam Systems, LLC

Java SE 7 Programming

How To Use A Sas Server On A Java Computer Or A Java.Net Computer (Sas) On A Microsoft Microsoft Server (Sasa) On An Ipo (Sauge) Or A Microsas (Sask

Java SE 7 Programming

Using DOTS as Apache Derby System Test

FileMaker 12. ODBC and JDBC Guide

Transcription:

Making Oracle and JDBC Work For You Presented to: TOUG DBA/Developer Day 2004 October 25, 2004 John Jay King King Training Resources john@kingtraining.com Download this paper and code examples from: http://www.kingtraining.com October 2004 Copyright @ 2004, John Jay King Page 1

Session Objectives Understand how to use JDBC (Java DataBase Connectivity) to access Oracle data Know the different types of Oracle JDBC connections supported Be able to query data from Oracle using JDBC Use an Oracle stored procedure via JDBC October 2004 Copyright @ 2004, John Jay King Page 2

Major Keywords Connection Statement Result Set Thin Client OCI Client October 2004 Copyright @ 2004, John Jay King Page 3

Oracle and Java Oracle 10g, Oracle9i and Oracle8i provide a Java Virtual Machine (JVM) built in to the database Oracle provides JDBC drivers to allow Java to use the database Oracle provides an SQLJ translator allowing the use of embedded SQL in Java JDeveloper is an Integrated Development Environment (IDE) that may be used to create Java programs using JDBC or SQLJ Common Object Request Broker Architecture (CORBA) support Oracle Application Server (Oracle9i AS) Support for JavaBeans and EJB October 2004 Copyright @ 2004, John Jay King Page 4

Database Connectivity with JDBC JDBC is a tool used to access SQL databases from Java JDBC 3.0 is supported by Oracle 10g, all of JDBC 2.0 and parts of JDBC 3.0 (the current release) are supported by Oracle9i JDBC or Oracle extensions JDBC allows programmers to: Connect to a database Query and Update a database Perform PL/SQL and call stored Procedures/Functions JDBC programs are database vendor and platform independent (mostly) unless Oracle-specific features are used October 2004 Copyright @ 2004, John Jay King Page 5

JDBC Drivers Oracle support three types of JDBC drivers: Oracle Thin JDBC driver Does not require Oracle client Creates its own Oracle Net/Net8/SQL*Net connection Downloadable (about 900k) Used for Applets Oracle OCI JDBC driver Requires Oracle Client Uses existing Oracle Net/Net8/SQL*Net connection Used for Applications on client and middle-tier applications Oracle Server JDBC driver (aka KPRB driver) Server-side only Used for server-side JDBC, Java stored procedures, and Enterprise Java Beans (EJBs) Supports communication between PL/SQL and Java October 2004 Copyright @ 2004, John Jay King Page 6

Which Driver for Me? Use the Thin JDBC driver for: Applets Most applications TCP/IP connections only Use the OCI JDBC driver for: Applications requiring the best performance Connections not using TCP/IP Use the Server-side JDBC driver for: Accessing other databases from within the database Use the Server-side Internal JDBC driver for: Programs running in the server, accessing the server October 2004 Copyright @ 2004, John Jay King Page 7

What Database Version? Thin JDBC drivers and OCI JDBC drivers work with: Oracle 10g Oracle 9.x Oracle 8.1.x Oracle 8.0.x (no support for objects) Oracle 7.x (no support for objects or LOBs) Oracle Server JDBC Internal drivers became available with Oracle 8.1.5 but can access data in Oracle 8.1.4 Oracle Server-side Thin driver became available in 8.1.7 October 2004 Copyright @ 2004, John Jay King Page 8

Oracle JDBC Features Oracle s JDBC drivers add several features to the standard Java JDBC JDBC 1.22 compliant, supports most JDBC 2.0 and parts of JDBC 3.0 Supports object-relational data Supports LOB data Provides Oracle-specific performance features Allows use of PL/SQL and Java stored procedures Supports all Oracle character sets Once a connection has been established, JDBC works the same regardless of driver being used October 2004 Copyright @ 2004, John Jay King Page 9

JDBC Drivers JDBC drivers for Oracle must be available for compilation and testing (.zip files gone in Oracle 10g): classes111.zip Java 1.1 (gone in Oracle 10g) classes12.zip Java 1.2, 1.3 (gone in Oracle 10g) classes12.jar Java 1.2, 1.3 (also classes12_g.jar) ojdbc14.jar Java 1.4 (also ojdbc14_g.jar) Additional of drivers support Oracle NLS features: nls_charset11.zip Java 1.1.x NLS characters nls_charset12.zip Java 1.2, 1.3, 1.4 NLS characters orai18n.jar Java 1.2, 1.3, 1.4 NLS characters CLASSPATH names ONLY ONE SET of zip/jar files Zip files may be found in:<oracle_home>/jdbc/lib October 2004 Copyright @ 2004, John Jay King Page 10

Using JDBC for Queries 1. Import java.sql.* and other needed packages 2. Load/register the JDBC driver 3. Connect to the database using JDBC 4. Create a statement object 5. Execute SQL statements and process results 6. Close the result set (technically not required, but safest to avoid memory leak issues) 7. Close the statement 8. Close the connection (disconnect from database) October 2004 Copyright @ 2004, John Jay King Page 11

Load/register JDBC driver This is one of the two parts of JDBC that is most impacted by switching database vendors Make sure that the JDBC driver has been made available to the JVM (in the classpath) Make sure the most current driver is used Connect using one of two mechanisms: DriverManager.registerDriver( new oracle.jdbc.driver.oracledriver()); or Class.forName("oracle.jdbc.driver.OracleDriver"); October 2004 Copyright @ 2004, John Jay King Page 12

Connect to the Database Connections are the other part of JDBC that is vendor-dependent, Oracle s connection string varies depending upon the driver in use A DBA's (DataBase Administrator's) help may be required to properly format the connect string and identify the appropriate settings It is a bad idea to hard-code userid and password information in code as shown in these examples, be sure to prompt the current user for the necessary information Be sure to close the connection, this is code that is often placed in a finally block October 2004 Copyright @ 2004, John Jay King Page 13

Connection Object Thin client connection jdbc:oracle:thin:@**hostcomputer**:**port**:**oraclesid** String url = "jdbc:oracle:thin:@tecra:1521:tec817"; String uid = "scott"; // prompt user for this String upswd = "tiger"; // prompt user for this Connection conn = DriverManager.getConnection(url,uID,uPswd); OCI client connection jdbc:oracle:oci8:@**oraclesid** String url = "jdbc:oracle:oci8:@tec817"; String uid = "scott"; // prompt user for this String upswd = "tiger"; // prompt user for this Connection conn = DriverManager.getConnection(url,uId,uPswd); October 2004 Copyright @ 2004, John Jay King Page 14

Connection Pools Creating and destroying database connections is one of the most expensive operations JDBC performs Performance may sometimes be improved dramatically by using Connection Pools Connection Pools represent a set of existing database connections that application programs share, eliminating the cost of create/destroy each time a program touches the database Creating and managing Connection Pools is often the province of the DBA staff, though, applications may create them manually October 2004 Copyright @ 2004, John Jay King Page 15

More on Connection Pools With Connection Pools the Application Server opens a given number of Connections to the database (dependent upon system configuration) and Java programs share them via ConnectionPool Caching the Connection objects provides significant performance improvements Connection Pools take advantage of JDBC 2.0's JNDI (Java Naming and Directory Interface) technology using ConnectionPoolDataSource, DataSource, and PooledConnection interfaces October 2004 Copyright @ 2004, John Jay King Page 16

Using Connection Pools As with normal Connections, Connection Pool implementations tend to be vendor-specific; many people find it useful to use a Connection Factory as part of framework to make the database vendor transparent to the Java programs The use of a Connection Factory encapsulates (hides) the complexity of the pool connection and looks to the JDBC developer like just another database connection A common mistake made by developers is failing to close() the pooled connection, closing the connection makes the pooled connection available for reuse (close() is polymorphic!) October 2004 Copyright @ 2004, John Jay King Page 17

Connect Using Pool try { // Retrieve the DataSource using logical JNDI name ctx = new InitialContext(env); ds = (DataSource) ctx.lookup("jdbc/mysample"); } catch (NamingException ename) { System.out.println("Error in lookup jdbc/mysample"); System.exit(0); } try { conn = ds.getconnection(); // NOT DriverManager // ** database access code goes here } catch (SQLException e) { // SQL exception code } October 2004 Copyright @ 2004, John Jay King Page 18

Create a Statement Object The Statement object contains the SQL statement to be executed For maximum portability use generic SQL For maximum performance/flexibility, it might be necessary to use Oracle-specific SQL and OracleStatement object Be sure to close the Statement object, this is code often found in a finally block October 2004 Copyright @ 2004, John Jay King Page 19

Statement Object Standard JDBC Statement: Statement stmt = conn.createstatement (); Oracle-specific Statements: OracleStatement stmt = conn.createstatement (); OraclePreparedStatement stmt = conn.createstatement(); October 2004 Copyright @ 2004, John Jay King Page 20

Result Set Immediately after a query, the result set pointer points one record before the first row returned, use the next method to get the first record It is not normally necessary to manually close the Result Set, it will be closed automatically when the Statement it is associated with is closed or reexecuted Due to memory-leak issues, it may be safest to close the Result Set October 2004 Copyright @ 2004, John Jay King Page 21

Execute SQL Statements To execute a query: String mysql = "SELECT ENAME,JOB,DEPTNO, " + " to_char(hiredate,'mm/dd/yyyy') HIREDATE " + " FROM EMP " + " WHERE DEPTNO = '" + myparm + "'" + " ORDER BY ENAME"; ResultSet rs = stmt.executequery(mysql); To execute an update or stored procedure call: String mysql = "UPDATE EMP SET SAL = SAL * 1.06 " + " WHERE ROWID = '" + saverowid + "'"; int nbrrows = stmt.executeupdate(mysql); October 2004 Copyright @ 2004, John Jay King Page 22

ROWID When updating or deleting rows previously displayed, be sure to store and use the Oracle ROWID for the column ROWID is the fastest possible access to a given row Don t show the ROWID to the user (pretty scary looking ) October 2004 Copyright @ 2004, John Jay King Page 23

Process Result Sets Data is processed a row at time in the ResultSet using the next method: while (rs.next()) { /** process SQL row **/ } Retrieve values one column at a time by name, or, by position in the SQL statement: String myempno = rs.getstring("empno"); String myempno = rs.getstring(1); October 2004 Copyright @ 2004, John Jay King Page 24

Result Set Processing Some other methods available for result set processing include: afterlast Moves cursor to the end of ResultSet beforefirst Moves cursor to the front of ResultSet clearwarnings Clears all warnings on ResultSet close Releases ResultSet object's database and JDBC resources immediately deleterow Deletes the current row first Moves cursor to first row in ResultSet getwarnings Returns the first warning reported insertrow Inserts a row into this ResultSet last Moves cursor to last row in ResultSet next Moves the cursor down one row previous Moves the cursor up one row October 2004 Copyright @ 2004, John Jay King Page 25

Result Set Testing Some ResultSet methods useful for testing: rowdeleted rowinserted rowupdated wasnull Test wasnull for each column value that might be null myempno = rs.getint("empno"); if (rs.wasnull()) myempno = 0000; myename = rs.getstring("ename"); if (rs.wasnull()) myename = " "; October 2004 Copyright @ 2004, John Jay King Page 26

Result Set Values Some standard methods used to process column values by name or by position: getbigdecimal getblob getboolean getbyte getclob getdate getdouble getfloat getint getlong getobject getshort getstatement getstring October 2004 Copyright @ 2004, John Jay King Page 27

OracleResultSet Extensions Oracle extensions if using OracleResultSet instead of ResultSet: getarray getbfile getblob getclob getnumber getoracleobject getraw getref getrowid getstruct October 2004 Copyright @ 2004, John Jay King Page 28

Scrollable Cursors Oracle 9i and 10g support scrollable cursors (JDBC 2.0 and later only) ResultSet objects may be specified as SCROLL_SENSITIVE when creating Statement, PreparedStatement, and CallableStatement objects Scrollable Cursors add new ResultSet methods: beforefirst() afterlast() first() last() absolute(nn) relative(nn) October 2004 Copyright @ 2004, John Jay King Page 29

JDBC Cleanup It is a good idea to put the Statement close and Connection close in a finally block finally { try { rs.close(); stmt.close(); // Close result set // Close statement // Close connection conn.close(); } catch (SQLException e) { // code for error closing things } } // More precise to have try-catch for // each close October 2004 Copyright @ 2004, John Jay King Page 30

Batch Processing Sometimes a program will be doing a large number of Insert, Update, or Delete statements Normally, JDBC performs an automatic commit after each SQL statement s execution This can be controlled using methods from the Connection object October 2004 Copyright @ 2004, John Jay King Page 31

Batch Processing Syntax To turn off autocommit conn.setautocommit(false); To add commands to the batch stmt.addbatch(insertupdatedeletestmt); To execute a batch-style command int [] updatecounts = stmt.executebatch(); To manually commit or rollback conn.rollback(); // conn.commit(); October 2004 Copyright @ 2004, John Jay King Page 32

Using Stored Procedures Using Stored Procedures is a simply a matter of knowing the procedure/function name, parameters, and return type (for functions) CallableStatement objects or OracleCallableStatement objects are used instead of the normal Statement objects Input parameters are set using setstring, setarray, setasciistream, setbigdecimal, setbinarystream, setblob, setboolean, setbyte, setbytes, setcharacterstream, setclob, setdate, setdate, setdouble, setfloat, setint, setlong, setnull, setobject, setref, setshort, setstring, settime, settimestamp, and setunicodestream Output parameters are defined using RegisterOutParameter Statement executeupdate() is used Get methods are used to retrieve output values October 2004 Copyright @ 2004, John Jay King Page 33

Calling a Procedure Note use of substitution/bind variables (OK with any SQL!) Variables are referenced via relative position in statement // Following is Oracle-specific CallableStatement stmt1 = conn.preparecall("begin addem(?,?,?); end;"); // Portable Stored Procedure call follows // CallableStatement stmt1 // = conn.preparecall("{call addem(?,?,?)}"); stmt1.setstring(1,"123"); stmt1.setstring(2,"456"); stmt1.registeroutparameter(3,types.varchar); stmt1.executeupdate(); System.out.println("Value returned is " + stmt1.getstring(3)); October 2004 Copyright @ 2004, John Jay King Page 34

Calling a Function CallableStatement stmt2 = conn.preparecall("begin? := times_2(?); end;"); stmt2.registeroutparameter(1,types.numeric); stmt2.setstring(2,"1234.56"); stmt2.executeupdate(); java.math.bigdecimal outval = stmt2.getbigdecimal(1); System.out.println("Value returned is " + outval); October 2004 Copyright @ 2004, John Jay King Page 35

CallableStatement Methods getbigdecimal getboolean getbyte getbytes getdate getdouble getfloat getint getlong getobject getshort getstring gettime gettimestamp registeroutparameter wasnull October 2004 Copyright @ 2004, John Jay King Page 36

OracleCallableStatement Extensions getarray getbfile getblob getclob getcursor getcustomdatum getnumber getoracleobject getraw getref getrowid getstruct October 2004 Copyright @ 2004, John Jay King Page 37

Good, Better, Best? JDBC s autocommit (the default) may be a poor performer when many SQL statements are involved Controlling commit/rollback manually will probably improve performance If many Insert/Update/Delete operations are involved, Batched SQL might improve performance more If many Insert/Update/Delete operations are involved, a Stored Procedure might work best October 2004 Copyright @ 2004, John Jay King Page 38

What is SQLJ? SQLJ is Pro*Java in appearance and functionality Relatively normal SQL statements are coded A pre-processor converts the SQL to two files: xxx.sqlj xxx.ser SQLJ source code SQLJ profile Tends to be a better performer for static SQL SQLJ is mentioned here because it is a viable alternative to JDBC in many cases SQLJ has been removed from Oracle 10g October 2004 Copyright @ 2004, John Jay King Page 39

What Does SQLJ Look Like? SQLJ clauses begin with a pound (#) sign and include standard looking SQL statements The statement below inserts a row into the EMP table passing three column values #sql {INSERT INTO EMP (EMPNO, LASTNAME, SALARY) VALUES( :empid, :lastname, :emppay) }; Remember how complex JDBC calls with replaceable values were? SQLJ is far simpler to code Interestingly, most Java programmers seem to prefer the JDBC code October 2004 Copyright @ 2004, John Jay King Page 40

Oracle Documentation Oracle online manuals (http://tahiti.oracle.com) Oracle10g/9i/8i Java Developer's Guide Oracle10g/9i/8i Java Stored Procedures Developer's Guide Oracle10g/9i/8i Java Tools Reference Oracle10g/9i/8i JDBC Developer's Guide and Reference Oracle9i/8i SQLJ Developer's Guide and Reference Oracle10g/9i/8i Supplied Java Packages Reference Javadoc for Oracle JDBC: <oraclehome>/jdbc/doc/javadoc.zip Lots of papers and examples: http://technet.oracle.com October 2004 Copyright @ 2004, John Jay King Page 41

Wrapping it all Up JDBC access allows full use of Oracle from Java programs Oracle-specific features improve performance at the cost of portability Review of the steps: 1. Load/register the JDBC driver 2. Connect to the database 3. Create a statement object 4. Execute SQL statements and process results 5. Close the result set (if used), statement, and connection (probably from a finally block) October 2004 Copyright @ 2004, John Jay King Page 42

Training Days 2005 Mark your calendar for: February 9-10, 2005! October 2004 Copyright @ 2004, John Jay King Page 43

To contact the author: John King King Training Resources 6341 South Williams Street Littleton, CO 80121-2627 USA 1.800.252.0652-1.303.798.5727 Email: john@kingtraining.com Paper & Sample Code: http://www.kingtraining.com Thanks for your attention! October 2004 Copyright @ 2004, John Jay King Page 44