简体   繁体   中英

How can I store list of Strings in DataBase?

I would like to create DataBase which rows will be: String model, String date production and list of Bitmaps converted to Strings. But I have no idea how can I create this list. Is there any possibility, for example, to create ArrayList in DataBase? or maybe there is another way to solve this problem.
I am beginner, so I ask for understanding and thank You for any tips

You have to create one string with some separator like | . If you want write one list of color.

white|blue|green|..

And write this in the database as string. Later to get all your colors you need to do this :

String strInDB = "white|blue|green";
String[] colors = strInDB.split(''|'');
ArrayList<String> myList = new ArrayList<String>(Arrays.asList(colors));

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM