Like This Site? 
 
RSS Feed Follow Us 

on Twitter! Be Our Fan!

Querying Data using the PreparedStatement Object

Share this post!
 Vote this!

Consider a scenario where a New Publishers, a pubhlishing company maintains information about the books and the authors in a database. The company wants an application using which they cab access the information about authors based on different criteria. For Example, it should retain all authors living in a city specified at runtime. In this scenario, we cannot use Statement object to retrieve information because the value needs to be specified at the runtime. We need to use the PreparedStatement object as it can accept runtime parameters.
The PreparedStatement interface is derived from Statement interface and  is available in the java.sql package. 
The PreparedStatement objects are compiled and prepared only once by JDBC.  more...

0 comments:

Post a Comment