Presentation is loading. Please wait.

Presentation is loading. Please wait.

Copyright © 2002 ProsoftTraining. All rights reserved. Building Database Client Applications Using JDBC 2.0.

Similar presentations


Presentation on theme: "Copyright © 2002 ProsoftTraining. All rights reserved. Building Database Client Applications Using JDBC 2.0."— Presentation transcript:

1 Copyright © 2002 ProsoftTraining. All rights reserved. Building Database Client Applications Using JDBC 2.0

2 Copyright © 2002 ProsoftTraining. All rights reserved. Lesson 1: Introduction to JDBC

3 Objectives Describe the purpose of JDBC Discuss the structure of a relational database Describe the purpose of SQL Discuss the client-server architecture Describe the JDBC architecture

4 JDBC—The Basics Sun Java database access API Microsoft Open Database Connectivity

5 Relational Databases Database management systems Primary keys Joins

6 Structured Query Language DDL DML DCL SQL data types

7 System Architecture Client/server architecture Three-tier architecture

8 Summary Describe the purpose of JDBC Discuss the structure of a relational database Describe the purpose of SQL Discuss the client-server architecture Describe the JDBC architecture

9 Copyright © 2002 ProsoftTraining. All rights reserved. Lesson 2: Using JDBC Drivers

10 Objectives Describe the various types of JDBC drivers Select a JDBC driver Load a JDBC driver Establish a connection with a database

11 JDBC Drivers JDBC-ODBC bridge driver Native-API driver JDBC-Net driver Pure Java driver Loading a driver

12 Establishing a Connection JDBC URLs The Connection interface

13 Summary Describe the various types of JDBC drivers Select a JDBC driver Load a JDBC driver Establish a connection with a database

14 Copyright © 2002 ProsoftTraining. All rights reserved. Lesson 3: Executing SQL Statements

15 Objectives Define tables in a database using JDBC Add new rows to a table using JDBC Perform queries on a database using JDBC Extract data from a ResultSet object Describe the purpose of transactions Use transactions to maintain data consistency

16 The Statement Interface Statement interface methods executeUpdate executeQuery

17 Transactions Using SQL Statements Allow you to group statements so that changes do not take effect until both tables are updated

18 Summary Define tables in a database using JDBC Add new rows to a table using JDBC Perform queries on a database using JDBC Extract data from a ResultSet object Describe the purpose of transactions Use transactions to maintain data consistency

19 Copyright © 2002 ProsoftTraining. All rights reserved. Lesson 4: Prepared Statements and Stored Procedures

20 Objectives Describe the purpose of prepared statements Use prepared statements to increase efficiency Describe the purpose of stored procedures Use stored procedures

21 Prepared Statements PreparedStatement interface Prepared statement parameters Executing prepared statements

22 Stored Procedures Precompiled Stored within the DBMS Remain permanently within the DBMS

23 Summary Describe the purpose of prepared statements Use prepared statements to increase efficiency Describe the purpose of stored procedures Use stored procedures

24 Copyright © 2002 ProsoftTraining. All rights reserved. Lesson 5: Metadata

25 Objectives Describe the purpose of metadata Extract metadata from a DBMS or database Extract metadata from a result set

26 Introduction to Metadata Metadata: data about data

27 DatabaseMetaData Determining DBMS product information Determining supported features Determining the database schema

28 ResultSetMetaData Extracting metadata from a result set

29 Summary Describe the purpose of metadata Extract metadata from a DBMS or database Extract metadata from a result set

30 Copyright © 2002 ProsoftTraining. All rights reserved. Lesson 6: SQLExceptions

31 Objectives Describe the purpose of SQLExceptions Catch SQLExceptions Determine the cause of a SQLException Recover efficiently from a SQLException

32 Introduction to SQLExceptions SQLException class helps determine when an error occurs and what type of error has occurred

33 try and catch Blocks catch block accepts an exception and provides some handling for recovering from an exception try block may have multiple associated catch blocks

34 SQLException Methods String getMessage( ); String getSQLState( ); int getErrorCode( ); SQLException getNextException( );

35 Summary Describe the purpose of SQLExceptions Catch SQLExceptions Determine the cause of a SQLException Recover efficiently from a SQLException

36 Copyright © 2002 ProsoftTraining. All rights reserved. Lesson 7: Scrollable and Updateable Result Sets

37 Objectives Describe the purpose of scrollable result sets Create and use a scrollable result set Describe the purpose of updateable result sets Create and use an updateable result set

38 Scrollable Result Sets Creating a scrollable result set Result set type constants Scrolling through a scrollable result set

39 Updateable Result Sets Creating an updateable result set Updating a result set Inserting a row Deleting a row

40 Summary Describe the purpose of scrollable result sets Create and use a scrollable result set Describe the purpose of updateable result sets Create and use an updateable result set

41 Copyright © 2002 ProsoftTraining. All rights reserved. Lesson 8: Batch Updates

42 Objectives Describe the purpose of batch updates Perform a batch update Perform a parameterized batch update Catch a BatchUpdateException

43 Introduction to Batch Updates Using batch updates –addBatch –executeBatch –clearBatch

44 Parameterized Batch Updates Combine the benefits of batch updates with those of prepared statements

45 The BatchUpdateException Class Performing batch updates

46 Summary Describe the purpose of batch updates Perform a batch update Perform a parameterized batch update Catch a BatchUpdateException

47 Building Database Client Applications Using JDBC 2.0 Introduction to JDBC Using JDBC Drivers Executing SQL Statements Prepared Statements and Stored Procedures Metadata

48 Building Database Client Applications Using JDBC 2.0 SQLExceptions Scrollable and Updateable Result Sets Batch Updates


Download ppt "Copyright © 2002 ProsoftTraining. All rights reserved. Building Database Client Applications Using JDBC 2.0."

Similar presentations


Ads by Google