This week's book giveaway is in the General Computing forum. We're giving away four copies of Arduino in Action and have Martin Evans, Joshua Noble, and Jordan Hochenbaum on-line! See this thread for details.
I am constructing a DAO which uses PreparedStatement to retrive data. DAO calls back different methods on the calling application to get SQL query, its parameters and other details (which are required to construct statement). Input parameter data types can be Int, Long or String.
As a common approach, can call call setString on all input parameters? Does it have any performance issue?
Anirudha, Yes, you can call setString() in all those cases. There might be a slight performance hit (if one at all), but not enough to worry about. Compared to the query and response time, it would be nothing.