File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Statement functions

 
Joe Wolf
Ranch Hand
Posts: 42
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you want to issue a CREATE, DROP or ALTER command in SQL, which function should you call on your Statement: executeQuery(), executeUpdate(), or execute()?
 
Robert Brunner
Ranch Hand
Posts: 49
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
executeUpdate, as you are doing SQL DDL statements. You should get zero rows returned in the update count.
 
krishnan sampath
Greenhorn
Posts: 3
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you want to execute a DDL statement from java, it is enough to run a stored procedure.. In the stored procedure use execute_immediate (for 8i and above) for executing the DDL statements.
If your oracle version 8 and use
DBMS_SQL.PARSE,DBMS_SQL.DEFINE_COLUMN,
DBMS_SQL.EXECUTE, for executing DDL statements
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic