Chapter 9 SQL in a server environment SQL in a Programming Environment embedded SQL persistent stored modules Database-Connection Libraries Call-level interface (CLI) JDBC PHP
Chapter 9 SQL in a server environment SQL in a Programming Environment embedded SQL persistent stored modules Database-Connection Libraries Call-level interface (CLI) JDBC PHP
SQL in Real Programs We have seen only how SQL is used at the generic query interface --an environment where we sit at a terminal and ask queries of a database. Reality is almost always different: conventional programs interacting with SQL
SQL in Real Programs We have seen only how SQL is used at the generic query interface --- an environment where we sit at a terminal and ask queries of a database. Reality is almost always different: conventional programs interacting with SQL
Options 1.SQL statements are embedded in a host language (e.g.,C). 2. Code in a specialized language is stored in the database itself (e.g., PSM,PL/SQL). 3. Connection tools are used to allow a conventional language to access a database (e.g.,CLI,JDBC,PHP/DB)
Options 1. SQL statements are embedded in a host language (e.g., C). 2. Code in a specialized language is stored in the database itself (e.g., PSM, PL/SQL). 3. Connection tools are used to allow a conventional language to access a database (e.g., CLI, JDBC, PHP/DB)
SQL in a Programming Environment Embedded SOL:add to a conventional programming language(C for example, we called host language )certain statements that represent SQL operation Host language+embedded SQL> code?
SQL in a Programming Environment Embedded SQL: add to a conventional programming language (C for example, we called host language ), certain statements that represent SQL operation. Host language+embedded SQL Æ code?
System Implementation Host Language Embedded SQL Preprocessing Host Language Function calls Host-language compiler SQL library Object-code program How to identify SQL statements? How to move data between SQL and a conventional programming language? Mismatch problem exists?
System Implementation How to identify SQL statements? How to move data between SQL and a conventional programming language? Mismatch problem exists? Host Language + Embedded SQL Preprocessing Host Language + Function calls Host-language compiler SQL library Object-code program