if ( ( args.length == 1 ) && ( args[0] instanceof NativeArray ) ) {
NativeArray array = (NativeArray) args[0];
resultSet.setMetaData( JavaScriptResultSet.createMetadata( array, thisObj ) );
} else if ( ( args.length == 2 ) && ( args[0] instanceof NativeArray ) && ( args[1] instanceof NativeArray ) ) {
NativeArray array = (NativeArray) args[0];
MemoryMetaData metaData = JavaScriptResultSet.createMetadata( array, thisObj );
// create some metadata objects
array = (NativeArray) args[1];
int length = (int) array.getLength();
String[] columnTypes = new String[length];
for ( int i = 0; i < length; i++ ) {
columnTypes[i] = array.get( i, thisObj ).toString();
}
metaData.setColumnTypes( columnTypes );
resultSet.setMetaData( metaData );
} else {
int length = args.length;
String[] columnHeaders = new String[length];
for ( int i = 0; i < length; i++ ) {
columnHeaders[i] = args[i].toString();
}
MemoryMetaData metaData = new MemoryMetaData( new String[][] { columnHeaders }, null );
resultSet.setMetaData( metaData );
}
return null;
}