This week's book giveaway is in the Clojure forum.
We're giving away four copies of Clojure in Action and have Amit Rathore and Francis Avila on-line!
See this thread for details.
Win a copy of Clojure in Action this week in the Clojure forum!
    Bookmark Topic Watch Topic
  • New Topic

Vector into Array

J. Alenis
Posts: 16
  • 0
  • Mark post as helpful
  • send pies
  • Report post to moderator
I would like to know if it is possible and how to do the following. I get a created Vector and I need to put it into an Array. Here are pieces of my program:

String [] columnName ={"sqlcode","sqlmessage","predicaat"};
String [] columnIO ={"out","out","in"};
String [] columnType ={"integer","varchar","varchar"};
Object [] columnValue ={"","","'nn>''123456789010'''"};

Vector in = new Vector();
for (int i=0; i<columnName.length;++i)
{Vector row = new Vector();

And I want all the elements in an array that will look like this:

String[][]SP_parms = {{"Out","integer","sqlcode","0"},
{"Out","varchar","sqlmessage",""} };
Can somebody please help me.
Vijayendra V Rao
Ranch Hand
Posts: 195
  • 0
  • Mark post as helpful
  • send pies
  • Report post to moderator
An Array is nothing but a collection of similar "type" elements. So, since a Vector is an Object, you can have an array of Objects. I don't think you will need to have a multi-dimensional array, the way you have put it. Just a normal array can be used to hold Object-type elements.

Try it out. It should be possible.
Dirk Schreckmann
Posts: 7023
  • 0
  • Mark post as helpful
  • send pies
  • Report post to moderator
Round these parts, posting the same question in multiple forums is bad practice. It can make it rather difficult to follow a conversation, plus folks spend time saying things that were just said.

Please continue in the duplicate thread in the Intermediate forum.
I agree. Here's the link:
    Bookmark Topic Watch Topic
  • New Topic