File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

PreparedStatement related query

 
S Majumder
Ranch Hand
Posts: 349
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi every body I have a query related to PreparedStatement.

Is it necessary to explicit cast to conn.prepareStatement(sqlQuery); ?

My code is like this :


Which one is better ?

regards,
S
 
Smitesh Shinde
Ranch Hand
Posts: 45
Firefox Browser Java
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You do not need to explicitly cast it as conn.prepareStatement itself returns object of type PreparedStatement
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic