EMBEDED - EMBEDDED SQL P.Mirunalini A.P,CSE SSNCE SQL in...

Info iconThis preview shows pages 1–5. Sign up to view the full content.

View Full Document Right Arrow Icon
EMBEDDED SQL P.Mirunalini A.P,CSE SSNCE
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
SQL in Application Code s SQL commands can be called from within a host language (e.g., C++ or Java) program. r SQL statements can refer to host variables (including special variables used to return status). r Must include a statement to connect to the right database. s Two main integration approaches: r Embed SQL in the host language (Embedded SQL, SQLJ) r Create special API to call SQL commands (JDBC)
Background image of page 2
Impedence Mismatch s Java uses native types r •int, char[], String, . .. r •collection classes s SQL uses tables r CHAR(7), VARCHAR(20), FLOAT, DATE, . .. r possibly huge amounts of data s Not obvious how to translate tables into Java objects s Results are instead accessed using cursors
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
SQL in Application Code (Contd.) Impedance mismatch: s SQL relations are (multi-) sets of records, with no a priori bound on the number of records. No such data structure exist traditionally in procedural programming languages such as C or C++.
Background image of page 4
Image of page 5
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 04/01/2012 for the course CSE,IT 101 taught by Professor Mirunaalini during the Spring '12 term at Indian Institute of Technology, Chennai.

Page1 / 20

EMBEDED - EMBEDDED SQL P.Mirunalini A.P,CSE SSNCE SQL in...

This preview shows document pages 1 - 5. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online