i had created a java project which is getting a resultset from mysql and i have to store my resultset into a hdf5 file, so how to do it properly?
Right now i am getting the data from sql in resultset and than storing it into List of Map and than converting it to byte array, storing that byte arry to hdf5 file. (because hdf5 support dimensional data only)
IHDF5Writer writer = HDF5Factory.open("farray.h5");
ByteArrayOutputStream bos = new ByteArrayOutputStream();
ObjectOutputStream oos = new ObjectOutputStream(bos);
oos.writeObject(data); // data is my List of Map variable
byte[] bytes = bos.toByteArray();
writer.writeByteArray("mydata", bytes);
writer.close();
And this storing my data to the hdf5 file but this not seems to be better approach, so is there is any better way to store the resultset into the hdf5 file? sorry for English and Grammar