aspose file tools
The moose likes JDBC and the fly likes PreparedStatement related query Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Databases » JDBC
Reply Bookmark "PreparedStatement related query " Watch "PreparedStatement related query " New topic
Author

PreparedStatement related query

S Majumder
Ranch Hand

Joined: Jun 03, 2009
Posts: 241
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

Joined: Feb 16, 2008
Posts: 44

You do not need to explicitly cast it as conn.prepareStatement itself returns object of type PreparedStatement
 
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: PreparedStatement related query
 
Similar Threads
PreparedStatement and NullPointerException
java.lang.ArrayIndexOutOfBoundsException: 1
preparestatment
getGeneratedKeys() causing exception
I'm posted 1000000000 times tell me idea