我有一个Student
类,具有以下属性:
Name, Department, Address, Grade.
现在我有一个包含一些Student
对象的ArrayList
,就像这样,
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"));
我需要将这个ArrayList传递给SQL Server存储过程,并将学生对象数据插入表中。如何在Java中最好地实现这一点?我需要使用存储过程。
如果有用的话,Java版本为8,Sql Server版本为2014。