File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Oracle/OAS and the fly likes sql Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » Oracle/OAS
Bookmark "sql" Watch "sql" New topic


sumit malik

Joined: Oct 31, 2001
Posts: 21
can anyone pls tell me about static embedded sql, dynamic embedded sql and embedded sql....thanks in advance...
Jamie Robertson
Ranch Hand

Joined: Jul 09, 2001
Posts: 1879

"embedded" in java programming usually refers to the SQLJ standard as opposed to JDBC.
all the information is here:
dynamic vs static:
"SQL can be used in two different ways: static SQL and dynamic SQL. Most OLTP applications are built in a fashion where SQL statements and the database schema against which they are to be run are known at application development time (static SQL). Static SQL can be written directly in Java using the standard SQLJ syntax. At compile time, the SQLJ translator recognizes these SQL statements and performs syntax checking, semantic checking, type checking, and schema checking on these statements. The SQLJ translator converts these embedded SQL statements into Java and generates a pure Java program. Oracle´┐Żs SQLJ translator converts embedded SQL statements into JDBC calls, the standard way to access databases from Java programs.
However, in other applications, like ad-hoc query tools, the SQL statements are not known until run-time (dynamic SQL). Dynamic SQL provides greater flexibility than static SQL since a calling program has the ability to construct and process SQL strings created at run-time. This capability comes at a greater programming cost due to the increased complexity of code necessary to support flexible, dynamic operations. Many applications do not require this level of complexity as the SQL commands that they use are pre-determined. SQLJ allows programmers the flexibility to mix JDBC calls in SQLJ programs thereby leveraging the benefits of both SQLJ and JDBC. However, Oracle recommends that application developers use SQLJ for developing applications that use static SQL and JDBC for applications that use dynamic SQL. "
I agree. Here's the link:
subject: sql
It's not a secret anymore!