Thread: how to do the PreparedStatement for Arrays or ArrayList?
Created on: 06/20/17 02:49 AM
Joined: 06/16/17 Posts: 2
how to do the PreparedStatement for Arrays or ArrayList?
06/20/17 2:49 AM
I have a table name tutor where one of the column named subject has mulitples values.
First, I have a jsp form and user can tick as many checkboxes, and the values will go into the subject column of my table - tutor in the database.
But, I do not know how to set and get the subject in order for the values of the checkboxes to be inserted into database. 1 ps.setString(13, m.getRemark()); 2 List<String> list = Arrays.asList(m.getSubject()); 3 ps.setArray(14, (Array) list); // ps is the PreparedStatement please help. Thanks.