130 likes | 308 Views
SQL (Structured Query Language) X/OPEN Call Level Interface For SQL ODBC (Open DataBase Connectivity) API JDBC (Java DataBase Connectivity) API. SQL (Structured Query Language) SQL89, SQL92, SQL3. X/OPEN Call Level Interface. JDBC-ODBC Bridge. ODBC API. JDBC API. Client.
E N D
SQL (Structured Query Language) X/OPEN Call Level Interface For SQL ODBC (Open DataBase Connectivity) API JDBC (Java DataBase Connectivity) API SQL (Structured Query Language) SQL89, SQL92, SQL3 X/OPEN Call Level Interface JDBC-ODBC Bridge ODBC API JDBC API
Client Database Server ApplicationGUI JDBC API Network Interface SQL Results SQL Requests SQL Results SQL Requests Network Connection JDBC API defines a set of interfaces and classes to be used for communicating with a database.
Client Application Database Server JDBC Driver Database Libraries Network Interface SQL Results SQL Requests SQL Results SQL Requests Network Connection JDBC Driver: translates java into SQL. JDBC drivers are implemented by database vendors. JDBC supports the ANSI SQL92 Entry Level standard.
JDBC supports: • ANSI SQL92 Entry Level Standard • Improvements of SQL89 • meta-data • DDL statements • Vendor independent syntax for using • stored procedures • scalar functions • outer joins • Note: • Since no syntax checking is performed by JDBC, • it is possible to execute any SQL statements at the expense of • portability.
Trusted Applications: Any stand-alone applications that are stored in local drives and have access to local resources. Downloaded applets are untrusted applications. They cannot write to local files, open arbitrary network connections, or even read environment variables. One way to make applets trusted is by code signing. JDBC applets are restricted from opening network connections to any host other than the one in which they are downloaded.
Guideline for security: • Never allow untrusted applets direct access to your database. • User should be required to provide credentials for every connection • made. • User credentials should not come from a local source such as a • current login ID. • All drivers should be tested and approved as JDBC COMPLIANT.
Components of JDBC: • The java.sql package • The test suite • The JDBC-ODBC bridge • What you need to develop programs in JDBC API? • A SQL92 compliant database. • A JDBC driver for your database. • The java Development Toolkit version 1.1 (JDK 1.1)
Type I: JDBC-ODBC Bridge Driver Database Client Application JDBC Driver Local Disk ODBC Driver Network Interface SQL Requests SQL Results Proprietary Database Protocol Network Interface Stand-Alone Applications run on Local Machine JDBC Driver: translates java calls into ODBC calls. Harder to debug, slower, not work for applets. Inexpensive, readily available. Server
Type II: Native-API-Partly Java Driver Database Client Application JDBC Driver Local Disk Native Database Libraries (Call Level Interface) Network Interface SQL Requests SQL Results Proprietary Database Protocol Network Interface JDBC Driver: use local libraries to communicate with database server. Java calls are translated into local CLI calls. Faster than the ODBC bridge, not work for applets. Server
Type III: JDBC-Net-All-Java Driver Database Client Application JDBC Driver (Client) Local Disk Network Interface SQL Requests SQL Results JDBC Driver Network Protocol Network Interface Server • JDBC Driver: client calls are translated into driver-specific network protocol. • JDBC Driver: server listenser translates the requests into CLI calls at server site. • All database-specific code resides on the server. • JDBC driver network protocol is not standardized. JDBC Driver (Server Listenser) Native Database Libraries (Call Level Interface)
Type III: JDBC-Net-All-Java Driver • JDBC driver network protocol is not standardized. • It implies that compatible client and server drivers • from a specific vendor must be used. • It can be used over internet.
Type IV: Native-Protocol-All-Java Driver Database Client Application JDBC Driver Local Disk Network Interface SQL Requests SQL Results Proprietary DB Protocol (in Java) Network Interface Server • JDBC Driver: 100% java and use no CLI native libraries. • Support applets containing the driver to be downloaded over the network, I.e., applets can communicate directly with the database.