Follow Our FB Page << CircleMedia.in >> for Daily Laughter. We Post Funny, Viral, Comedy Videos, Memes, Vines...


preparedstatement p= new preparedstatement
is it possible ?

Answers were Sorted based on User's Feedback



preparedstatement p= new preparedstatement is it possible ?..

Answer / satya veni

No.Interfaces can not be instantiated.
PreparedStatement ps=con.PreparedStatement("query");

Is This Answer Correct ?    26 Yes 2 No

preparedstatement p= new preparedstatement is it possible ?..

Answer / suresha

correction.

Preparedstatement ps=con.Preparestatement("some query");

suresha

Is This Answer Correct ?    13 Yes 3 No

preparedstatement p= new preparedstatement is it possible ?..

Answer / suresha

No,It should be following syantx

Preparestatement ps=con.preparestament("some query");

Is This Answer Correct ?    12 Yes 3 No

preparedstatement p= new preparedstatement is it possible ?..

Answer / sivam

No. Because PreparedStatement is an interface. we can not
create direct object instance in this interface, but we can
create reference.

ex:

PreparedStatement pst=con.PrpareStatement("Query");

Is This Answer Correct ?    12 Yes 4 No

preparedstatement p= new preparedstatement is it possible ?..

Answer / venkatesh

Correction. Syntax should be....

PreparedStatement ps = conn.prepareStatement("Query");

Thanks.

Is This Answer Correct ?    10 Yes 2 No

preparedstatement p= new preparedstatement is it possible ?..

Answer / abc

No,Syntax..............
PreparedStatement st=con.prepareStatement("query");
Thanks!

Is This Answer Correct ?    5 Yes 0 No

preparedstatement p= new preparedstatement is it possible ?..

Answer / t.l.n.prasad

no becoz PraparedStatement is an interface we can't
instantiate direcly but we can instantiate like this

PreparedStatement ps=con.PreparedStatement("Query");

where "con" is an Object of Connection interface
ie
Connection con=DriverManager.getConnection();

Is This Answer Correct ?    7 Yes 3 No

preparedstatement p= new preparedstatement is it possible ?..

Answer / 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

preparedstatement p= new preparedstatement is it possible ?..

Answer / guest

dfg

Is This Answer Correct ?    2 Yes 12 No

preparedstatement p= new preparedstatement is it possible ?..

Answer / chandrakala

No, the statement must be look like this

PreparedStatement p=new perpareStatement("query");

Is This Answer Correct ?    6 Yes 16 No

Post New Answer



More JDBC Interview Questions

Can you define a foreign key, with a key from the same table?

2 Answers   IBM,


Is jdbc faster than odbc?

0 Answers  


What is Statement and PreparedStatement? whatz the difference?

2 Answers  


How many packages are available in jdbc api?

0 Answers  


What is hbm xml?

0 Answers  






Which is better jpa or jdbc?

0 Answers  


What is the meaning of “dirty read” in the database?

0 Answers  


How to know howmuch data is truncated?

0 Answers   Mastek,


What is the use of getGeneratedKeys() method in Statement?

0 Answers  


Explain about multiple implementations and drive manager?

0 Answers  


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

0 Answers  


Where is jdbc used?

0 Answers  






Categories