I have a java ArrayList of a datastructure (string name, string email). The task is, to save the list in the database. I have an approach in my mind to use a for loop and use statement.setString( i, name) etc. Is there any better solution. Thanks in advance.
Share
Since you’re going to use plain JDBC, a batch statement might be useful to you:
So the idea you already have seems good to me. You’ll find more info here:
http://java.sun.com/developer/Books/JDBCTutorial/