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: string list = "123,467,980";

Now if I take this string in the stored procedure, how will it work?

I can not use it as the following:

  select * table_name where code in (list_var)   

This functionality will be the best way to get that so no one can guide me.

Type your SQL on your client side:

  string sql = "Select * from tablemap" where in the code ("+ list_var +") ";   

Or, if you want to call stored stored procedures with the actual parameters shown in your list string:

  String [] id = list.split (","); String sql = "{call for your processing ("; (int i = 0; i   

Alternatively:

  string sql = "{call your phone (" + + list + ")}"; Callable Stattement cst = con.prepareCall (sql);    

Comments

Popular posts from this blog

ios - Adding an SKSpriteNode to SKScene from a child SKSpriteNode -

Matlab transpose a table vector -

c# - Textbox not clickable but editable -