Ho una classe Student
con i seguenti attributi:Come passare i parametri con valori di tabella dalla procedura memorizzata java a sql server?
Name, Department, Address, Grade.
ora ho un ArrayList
che contiene alcuni Student
oggetti come questo,
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"));
ho bisogno di passare questo arraylist al server SQL memorizzata procedura e inserire i dati dell'oggetto studente nella tabella. Come raggiungere al meglio questo in Java? Sono obbligato ad avere una procedura memorizzata.
Java versione 8, Sql Server 2014 se di qualsiasi utilizzo.
https://social.msdn.microsoft.com/Forums/sqlserver/en-US/f7377f1c-f235-4870-b4a9-eab041fbd7b5/is-tablevalued-parameters-available-in-java-jdbc? forum = sqldatabaseengine –
Vedere anche https://blogs.technet.microsoft.com/dataplatforminsider/2016/04/04/preview-the-microsoft-jdbc-driver-6-0-for-sql-server/ e https://msdn.microsoft.com/en-us/library/mt651781.aspx Si noti che ciò richiede il driver di anteprima JDBC 6.0 (!) di SQL Server. –