Embedding SQL Statements Within Java Using SQLJ

SQLJ enables developers to write efficient and compact programs. SQLJ is built on top of JDBC and enables application developers to embed SQL statements within Java programs. A preprocessor is used to translate SQLJ syntax to Java code that makes JDBC calls to the database. Oracle's JDeveloper, which is a standard Java development tool, can be used to develop and debug SQLJ programs. Use of SQLJ improves the productivity and manageability of Java code for several reasons:

  • It provides code that's significantly compact compared to JDBC.

  • Typed cursors enable the use of strong-typed queries.

  • SQL statements are checked at compile time, enabling early detection of errors.

Using JDBC, a calling program ...

Get e-Commerce Applications Using Oracle8i and Java from Scratch now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.