• Post Reply Bookmark Topic Watch Topic
  • New Topic

prepared or general statement in JDBC

 
Rajaram csse
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
which one is heavier prepared / Statement
what about the maximum number of queries that could be run per connection in JDBC.
 
Shailesh Chandra
Ranch Hand
Posts: 1082
Java Oracle Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Did you try searching on web this first hit on web

both have different purpose and this is written on asktom

The use of a Statement in JDBC should be 100% localized to being used for DDL (ALTER, CREATE, GRANT, etc) as these are the only statement types that cannot accept BIND VARIABLES.

PreparedStatements or CallableStatements should be used for EVERY OTHER type of statement (DML, Queries). As these are the statement types that accept bind variables.

This is a fact, a rule, a law -- use prepared statements EVERYWHERE. Use
STATEMENTS almost no where.


about the maximum number of queries there is no practicle limit


Shailesh
[ June 19, 2006: Message edited by: Shailesh Chandra ]
 
my overalls have superpowers - they repel people who think fashion is important. Tiny ad:
the new thread boost feature brings a LOT of attention to your favorite threads
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!