0

I have successfully implemented connection with oracle using ojdbc6.jar.

Now I have curiosity that how can I insert Arraylist containing objects of specific class into oracle database by procedural call?

For example I have MyEmployee class and I have made Arraylist of Employee Class as follows :

List<MyEmployee> array = new ArrayList<MyEmployee>();
array.add(requestDetails1);
array.add(requestDetails2);

I want that I pass this whole array in a manner while calling Callable Statement so that each object goes as a row in table.

Sabir Khan
  • 9,826
  • 7
  • 45
  • 98
Utkarsh Saraf
  • 475
  • 8
  • 31
  • Do you mean each `MyEmployee` Object should go to some table `Employee` as a row?Also, to get more accurate answers, show your JDBC code , INSERT or UPDATE SQL, and Table details too. – Sabir Khan Feb 02 '16 at 12:57

1 Answers1

0

You can add array parameters to your query using, preparedStatement.setArray() method. Keep this one in mind: java.sql.PreparedStatement.setArray() : Unsupported cross conversion

Community
  • 1
  • 1
Limit
  • 458
  • 7
  • 19