This is more of an efficiency question: When performing JDBC in an Android application, should I use preparecall or createstatement with a stored procedure? Here is an example of a method in my code which calls a stored procedure and works:
public static ResultSet getUserNames (String userid) {
ResultSet rs = null;
try {
cstmt = con.prepareCall("{call dbo.StoredProcedure(?)}");
cstmt.setString("@ID", userid);
cstmt.setQueryTimeout(10);
rs = cstmt.executeQuery();
return rs;
} catch (Exception e) {
Log.e("DB Error:", e.getMessage());
return null;
}
}