my dog learned polymorphism
The moose likes JDBC and the fly likes static vs dynamic sql Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


JavaRanch » Java Forums » Databases » JDBC
Reply Bookmark "static vs dynamic sql" Watch "static vs dynamic sql" New topic
Author

static vs dynamic sql

tarik el berrak
Greenhorn

Joined: Oct 06, 2006
Posts: 29
Hi all,

What's the difference between static and dynamic sql ? which must be used and why ?

Thanks


SCJP 1.5<br />New Target (SCWCD 5)
Jeanne Boyarsky
internet detective
Marshal

Joined: May 26, 2003
Posts: 26496
    
  78

Tarik,
IBM has a good comparison. From a Java perspective, it is good to use PreparedStatements to handle your binding variables so you don't have to worry about things like date formats and SQL injection.


[Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Blogging on Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, OCAJP, OCPJP beta, TOGAF part 1 and part 2
 
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: static vs dynamic sql
 
Similar Threads
What is the use of using EXECUTE IMMEDIATE in Oraccle PL/SQL
Dynamic SQL with JDBC
sql
SQLJ vs JDBC
Dynamic Vs Static SQL