Overview of Prepared Statements
Sometimes it is more convenient to use a PreparedStatement object for sending SQL statements to the database. This special type of statement is derived from the more general class, Statement, that you already know.
OCA7
Amruta Mistry wrote:PreparedStatement is an interface while Statement is a class
If you refer JDBC API you will get more idea about same.
OCA7
Enkita mody wrote:If it would have been then why do i ask here ?.See this http://docs.oracle.com/javase/7/docs/api/java/sql/Statement.html
"Leadership is nature's way of removing morons from the productive flow" - Dogbert
Articles by Winston can be found here
Winston Gutkowski wrote:
Enkita mody wrote:If it would have been then why do i ask here ?.See this http://docs.oracle.com/javase/7/docs/api/java/sql/Statement.html
Enkita, there is no point in asking vague questions and then getting snippy with someone who's trying to help you. Amruta is absolutely right; it IS explained in the JDBC API (which comprises a lot more than just one class) AND in the JDBC tutorials.
Please ShowSomeEffort and SearchFirst (←click). Nobody here is simply going to spoon-feed you an answer; and if they do, the chances are it will be deleted.
Winston
OCA7
Enkita mody wrote:He said Statement is class so i gave him link that API is showing that interface not class.Do you think i did wrong ? i apologize if i did.thanks for your help
"Leadership is nature's way of removing morons from the productive flow" - Dogbert
Articles by Winston can be found here
Winston Gutkowski wrote:
Enkita mody wrote:He said Statement is class so i gave him link that API is showing that interface not class.Do you think i did wrong ? i apologize if i did.thanks for your help
OK, fair enough. But I suggest that next time you BeNice and point out the error.
The fact is that JDBC implementations are supplied by 3rd parties - generally the company that produced the database - so the likelihood is that MOST things you use in such a framework will be interfaces.
Winston
OCA7
Enkita mody wrote:I don't understand what does it mean ?
PreparedStatement and Statement both are interface not class !!
Jesper de Jong wrote:
Enkita mody wrote:I don't understand what does it mean ?
PreparedStatement and Statement both are interface not class !!
It could be that this is just a mistake in the tutorial. Don't expect everything to be perfect and without errors - the Oracle tutorials and documentation have been written by people who can make mistakes, just like everybody else.
This particular mistake doesn't make the whole tutorial incomprehensible.
OCA7
Jesper de Jong wrote:
Enkita mody wrote:I don't understand what does it mean ?
PreparedStatement and Statement both are interface not class !!
It could be that this is just a mistake in the tutorial. Don't expect everything to be perfect and without errors - the Oracle tutorials and documentation have been written by people who can make mistakes, just like everybody else.
Supplying Values for PreparedStatement Parameters
You must supply values in place of the question mark placeholders (if there are any) before you can execute a PreparedStatement object. Do this by calling one of the setter methods defined in the PreparedStatement class.
OCA7
Consider Paul's rocket mass heater. |