Array Object to Database
I have an arraylist As such :-
products.add( new CarsSubProduct( "FordMustang",1,1000,10000 ) );
FordMustang is Car name
1 is Car number
1000 is total number of cars in stock
10000 is price per car
I will like to Store it to access database or excel.Please how can these be done.
Excel isn't a database, so I wouldn't use that.
I'd hesitate to call Access one, but that's just me...;)
Anyway, create a table in Access that matches your CarsSubProduct class, with columns defined for each of the attributes you want to store (name, number, etc). Then write some JDBC in your Java to make a series of INSERT calls for each car (looping round the array).
There are preferred ways of doing that last bit (batching for example), but in your case it's probably best to just stick to a loop of individual INSERTs.
Look at the Sun JDBC tutorial, which'll give you the basics for doing all that.