A)
->Supply values to the place holders (question marks (?)) is nothing but binding of parameters.
->these parameters are known as “in parameters”.
“in parameters” are those parameters whose values are not supply at query compilation time, instead, supplied at query execution time.
->Binding of parameters is done by calling Setxxx(int index,value) on PreparedStatement object. The first argument of the method is question mark number (starting number is 1) in the query. The 2nd argument id value.
->Setxxx() methods are mirror methods of the getxxx methods of ResultSet.
Ex:
ps1.SetInt(1,1001);
ps1.SetInt(1,1001);
ps1.SetString(2,”prince”);
ps1.SetFloat(3,7000);
ps2.SetFloat(1,500);
ps2.SetInt(2,1001);
Comments
Post a Comment