JDBC Statements
There are three main types of Statement objects: the base class Statement , the PreparedStatement , and the CallableStatement . These objects are instantiated from your JDBC Connection object. Following table provides a summary of each interface's purpose to understand how do you decide which interface to use: Interfaces Recommended Use Statement Use for general-purpose access to your database. Useful when you are using static SQL statements at runtime. The Statement interface cannot accept parameters. PreparedStatement used to run Pre compiled sql. Use when you plan to use the SQL statements many times. The PreparedStatement interface accepts input parameters at runtime. CallableStatement used to execute the stored procedures. The CallableStatement interface can also accept runtime input parameters. Note:For simplicity, in the following examples we will use the Locations table in hr schema that we used...