What is the difference between static and dynamic SQL?

Ads
 

What is the difference between static and dynamic SQL?

What is the difference between static and dynamic SQL?

View Answers

November 18, 2010 at 1:24 PM

Hi,

Static SQL is SQL statements in an application that do not change at runtime and, therefore, can be hard-coded into the application.Static SQL is usually targeted at a specific database and in many cases gets stored in stored procedures. Many applications (especially Enterprise Applications) reach a stage where some dynamic data manipulation is required and static SQL techniques no longer sufficient.

Dynamic SQL is SQL statements that are constructed at runtime. Dynamic SQL generation is also needed in applications where the databases structure itself is dynamic. Many Enterprise Applications allow users to customize the way data is stored and displayed.

for example, the application may allow users to enter their own queries. Thus, the SQL statements cannot be hard-coded into the application.

Static SQL provides performance advantages over dynamic SQL because static SQL is preprocessed, which means the statements are parsed, validated, and optimized only once.

Thanks.

Ads









Related Tutorials/Questions & Answers:
What is the difference between a static and a non-static inner class?
What is the difference between the >> and >>> operators?
Advertisements
what is the difference between extends and implements
what is the difference between extends and implements
what is the Difference between weblogic and jboss?
what is the difference between pop and oop
What is the difference between hibernate and spring
What is the difference between $message and $$message?
What is the difference between a constructor and a method?
What is the difference between a JDK and a JVM?
What is difference between Path and Classpath?
what is the difference between distributed application and web application?
What is difference between singleton and prototype bean?
What is the difference between JSF, Servlet and JSP?
What’s the difference between load() and get()?
What is the difference between JPA and Hibernate?
what is the difference between productList==null and productList.size()==0
What is the difference between the Boolean & operator and the && operator?
What are difference between Bean Factory and Application Context ?
What is the difference between component and tag in JSF?
What is the difference between GET and POST method?
What is difference between UNIX Hosting and Window Hosting?
What is the difference between an if statement and a switch statement?
What is the difference between Big Data and Hadoop?
What is the difference between Big Data and Hadoop?
what is the difference between jdk 1.4 and 1.5 and 1.6
What is the difference between a break statement and a continue statement?
what is the difference between access specifiers and access modifiers in java?
In Java, what's the difference between public, default, protected, and private?
What is difference between Core Java and Advanced Java?
What is difference between Core Java and Advanced Java?

Ads