preparedstatement p= new preparedstatement
is it possible ?
Answers were Sorted based on User's Feedback
Answer / satya veni
No.Interfaces can not be instantiated.
PreparedStatement ps=con.PreparedStatement("query");
| Is This Answer Correct ? | 27 Yes | 2 No |
Answer / suresha
No,It should be following syantx
Preparestatement ps=con.preparestament("some query");
| Is This Answer Correct ? | 13 Yes | 3 No |
Answer / suresha
correction.
Preparedstatement ps=con.Preparestatement("some query");
suresha
| Is This Answer Correct ? | 13 Yes | 4 No |
Answer / venkatesh
Correction. Syntax should be....
PreparedStatement ps = conn.prepareStatement("Query");
Thanks.
| Is This Answer Correct ? | 10 Yes | 2 No |
Answer / abc
No,Syntax..............
PreparedStatement st=con.prepareStatement("query");
Thanks!
| Is This Answer Correct ? | 5 Yes | 0 No |
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 |
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 |
Answer / chandrakala
No, the statement must be look like this
PreparedStatement p=new perpareStatement("query");
| Is This Answer Correct ? | 6 Yes | 16 No |
Result set’s index starts with 0 or 1?
How do java applications access the database using jdbc?
What is Normalization?
4 Answers Accenture, Atos Origin,
What is metadata in jdbc?
How do I load a database driver with JDBC 4.0 / Java 6?
What is the use of getGeneratedKeys() method in Statement?
How many ways that we can view a result set?
What is the difference between setmaxrows(int) and setfetchsize(int)?
what is the meaning of following code snippets Class c=class.forName(driverClassName); Driver d=(driver)c.newInstance();
How to get the data from a table into a buffer?
Is jdbc and orm?
What is odbc jdbc?