01.09.2016 Views

Beginning Oracle Database 11g Administration From Novice to Professional

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

CHAPTER 2 SQL AND PL/SQL 29<br />

Embedded SQL<br />

Application programs written by application software developers can communicate with<br />

an <strong>Oracle</strong> database only by using SQL. These application programs must therefore be<br />

linked with <strong>Oracle</strong>- supplied routines that give them the capability <strong>to</strong> communicate with<br />

an <strong>Oracle</strong> database.<br />

Listing 2-9 shows an example of SQL statements embedded in a Java program. Each<br />

embedded SQL statement is prefixed with the phrase . The program lists the names<br />

of all parts supplied by a specified supplier and the price quote in each case; the account<br />

name and password required <strong>to</strong> connect <strong>to</strong> the database have <strong>to</strong> be provided <strong>to</strong> the program<br />

at runtime.<br />

Listing 2-9. SQL Commands Embedded in a Java Program

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!