I have a Student class with the following attributes:
Name, Department, Address, Grade.
Now I have an ArrayList that contains some Student objects like this,
List<Student> stuList = new ArrayList<Student>(); stuList.add(new Student("Tom","Comp", "123 street", "A")); stuList.add(new Student("Jery","Comp", "456 street", "A+")); stuList.add(new Student("Mac","Maths", "Dum Street", "B"));
I need to pass this arraylist to the sql server stored procedure and insert the student object data into the table. How to achieve this in Java? I must have a stored procedure.
Java version 8, Sql Server 2014, if used.
java sql-server sql-server-2008 jdbc mssql-jdbc
Umakanth
source share