Java takes the value entered from the input form
String s = new String(request.getParameter("authorName")); Пример : authorName = "user1 user2 user3"
Then makes a split and gets
user1 user2 user3
how to transfer all these values in one PreparedStatement
query1 = connection.prepareStatement("INSERT INTO authors (author_name) VALUES(?)"); query1.setString(1, AuthorName);
if done in this form
for (String retval: s.split(" ")) { document.setAuthorName(retval); }
then it only transmits the last value that is
user3
but it is necessary to transfer everything + the number of split lines dynamically.
query1.setString(1, retval); query1.executeUpdate();
query1.setString(1, retval); query1.executeUpdate();
(based on examples from docs.oracle.com/javase/tutorial/jdbc/basics/prepared.html ) - Mike