How to save String [] in MySQL

3
Hello, I would like to save a String[] in MySQL, but I do not know the type of datatype that saves String[] , nor what method I use to store this information.

    
asked by anonymous 17.05.2016 / 18:52

1 answer

0

I assume you are using the Java and JDBC language for bank access, but it was not very well specified.

But you can do something like this: String [] array = {"java", "JDBC", "Hibernate"};

String vectorString = Arrays.toString (array); // the string will be: [java, JDBC, Hibernate]

Then save the vectorString in the database as type VARCHAR. It is an option, but I would advise you to study about ORM and object persistence.

    
17.05.2016 / 21:54