Actually, you don't really need to know how it happens. It just does. It's definitely faster, for the most part, especially if you're going to run the same query many times. Also, PreparedStatements are safer. You don't have to worry about the "'" character when building up an OQL string if you're binding in query parameters.
James Carman, President<br />Carman Consulting, Inc.
Hi Gopal As you know PreparedStatements are subclass of Statements. It means PreparedStatement does something special, that is when you execute a PreparedStatement for the first time, the query string gets executed, during which a execuation plan is made for that query and maintained for all the further calls for the same query at db level, where for Statement when the query IS FIRED, each time a new execution plan is created. Creation of this plan is a heavy process looking at number of user hitting the website. As u can see this makes PreparedStatement much faster than the Statements. Morever u have the flexibility of passing the parameters to the PreparedStatement.