OK, so your table-of-contents is actually an array of strings.
Your choices are:
Create a new table so that each array element is a row in the table. You will probably need columns for external key and each string's index within its table-of-contents. This gives you a proper One-to-Many relationship between the ToC and its elements (or the Article and the ToC elements ... depending on how you chose to model it.) (Borrowed from @oldCurmudgeon's comment.)
Use Java serialization to serialize the String[]
and use a BLOB
column type.
Create (or choose) a custom encoding scheme to turn the String[]
into a textual representation and store it in a TEXT
column.
If you want to be able to query and/or update the individual table-of-content elements, then the first scheme is the way to go.
@ppeterka points out (correctly) that it would be good for you to read up on the topic of Database Normalization ... which is about designing schemas to reduce duplication of information. In this case, it will help you weigh up the alternative ways of turning an abstract model (e.g. a "One to Many relationship") into a database schema.