JDBC - PowerPoint PPT Presentation

1 / 12
About This Presentation
Title:

JDBC

Description:

JDBC By Four driver types of JDBC (1) JDBC-ODBC bridge plus ODBC driver: Four driver types of JDBC (2) Native-API partly Java driver: Four driver types of ... – PowerPoint PPT presentation

Number of Views:82
Avg rating:3.0/5.0
Slides: 13
Provided by: dian212
Category:
Tags: jdbc | jdbc

less

Transcript and Presenter's Notes

Title: JDBC


1
JDBC
  • By ???

2
Four driver types of JDBC (1)
  • JDBC-ODBC bridge plus ODBC driver

A
Java Database Client
JDBC- ODBC bridge
ODBC driver
Database Server
B
C
3
Four driver types of JDBC (2)
  • Native-API partly Java driver

Java Database Client
JDBC Driver Java binary
Vender- specific protocol
Database Server
4
Four driver types of JDBC (3)
  • JDBC-Net pure Java driver

A
Database Client
Database Access Server
JDBC Driver pure Java
Database Server
B
C
5
Four driver types of JDBC (4)
  • Native-protocol pur Java driver

Java Database Client
JDBC Driver pure Java
Vender- specific protocol
Database Server
6
Example AccessApp(1)
  • ????Class
  • DriverManager Class
  • getConnection(String url), or
  • getConnection(String url, String userID, String
    password), or
  • getConnection(String url, Properties arguments)
  • url ---- jdbcsubprotocolsubname

7
Example AccessApp(2)
  • Connection Interface
  • close()
  • getMetaData() - ??DatabaseMataData
    interface?????????????
  • createStatement() - Creates an SQL Statement
    object
  • Statement Interface
  • executeQuery() - SELECT, return ResultSet object
  • executeUpdate() - INSERT, UPDATE, DELETE
  • execute() - return boolean

8
Example AccessApp(3)
  • getResultSet() , getMoreResults() - retrieve the
    ResultSet object
  • ResultSet Interface
  • ???????row, ??next()??cursor?????row.

9
Transaction Processing(1)
  • Solves the database update problem.
  • setAutoCommit(), commit(), rollback().
  • Transaction Isolation
  • Eliminates problems associated with multiple
    database.
  • Transaction isolation levels - Hegher levels
    executes first. (reduces database performance ??)

10
Transaction Processing(2)
  • getTransactionIsolation() , getTransactionIsolatio
    n() (Connection Interface) , supportsTransactionIs
    olation() (DatabaseMetaData Interface).
  • EX CommitApp

11
Transaction Isolation
  • Eliminates problems associated with multiple
    database updates.
  • Transaction isolation levels - Hegher levels
    executes first. (reduces database performance ??)

12
Database Security
  • Relies on the database server to provide security
    protection.
  • JDBC driver to database server communication
    security protection.
Write a Comment
User Comments (0)
About PowerShow.com