preparedstatement p= new preparedstatement
is it possible ?

Answer Posted / surya, samcomm technologies pv

yes, but that is not the way to create object for the
interface. using Anonymous inner class.

syntax...

PreparedStatement ps=new PreparedStatement() {

U should implement all the methods of this
interface inside this block.

};

or if u feel this is overhead, then simply get the
reference for this interface in the following way.

PreparedStatement ps=con.prepareStatement("query");

Is This Answer Correct ?    5 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Describe how the jdbc application works.

501


code to insert values/rows into oracle database from a java swing textfield when a button is pressed(using preparedstatements)

3861


Give steps to connect to the db using jdbc?

564


Explain the role of driver in jdbc.

535


What is getconnection method in java?

484






What is batch processing and how to perform batch processing in jdbc?

494


What are the benefits of PreparedStatement over Statement?

507


What is an escape syntax?

505


Why we use jdbc instead of odbc?

482


What are the common jdbc exceptions?

494


What do you mean by database connection pooling?

496


Explain about column name and getter method?

573


What are the packages are used in jdbc?

546


Why isn't the java.sql.DriverManager class being found?

549


Why prepared statements are faster?

506