0

I have been banging my head against the wall for a while and I can't figure out how I could store an ArrayList into a sqlite column. I was thing it would work like the following:

Storing into database:

ArrayList -> String
String -> Sqlite column

Retrieving:

Sqlite column data -> ArrayList

However, I am unsure on how to accomplish this? Any guidance or advice?

2
  • an arraylist is a list of things, not a single item, so unless you store it as a delimited string then maybe creating a one to many relationship would be better. Commented Apr 15, 2014 at 5:35
  • see stackoverflow.com/questions/3142285/… Commented Apr 15, 2014 at 5:36

1 Answer 1

0

Convert List to comma (whatever) delimited String.

Convert delimited String to List.

You will need a large text column though. You never know how large these lists can get. As @Java1 suggested, maybe a master/detail would be better for this?

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.