java - how to pass a list to sql query in the below mentioned scenerio -
I have to give a list in a stored procedure that the user has selected that list as a string in the Java end . Example: Now if I take this string in the stored procedure, how will it work? I can not use it as the following: This functionality will be the best way to get that so no one can guide me. Type your SQL on your client side: Or, if you want to call stored stored procedures with the actual parameters shown in your Alternatively: string list = "123,467,980";
select * table_name where code in (list_var)
string sql = "Select * from tablemap" where in the code ("+ list_var +") ";
list string:
String [] id = list.split (","); String sql = "{call for your processing ("; (int i = 0; i
string sql = "{call your phone (" + + list + ")}"; Callable Stattement cst = con.prepareCall (sql);
Comments
Post a Comment