Sunday, September 9, 2012

Differentiate between a Statement and a PreparedStatement.

• A standard Statement is used for creating a Java representation for a literal SQL statement and for executing it on the database. 

• A PreparedStatement is a precompiled Statement. 

• A Statement has to verify its metadata in the database every time. 

• But ,the prepared statement has to verify its metadata in the database only once.

• If we execute the SQL statement, it will go to the STATEMENT. 

• But, if we want to execute a single SQL statement for the multiple number of times, it’ll go to the PreparedStatement.

How to Calculate the Future Investment Value of Investment.

Below java program for calculate future investment value. Here calculate s using the formula futureInvestmentValue =investmentAmount x (...