I am reading from a UniVerse database using UniObjects for Java using the UniFile.read()
method. This is an example of the type of code I use for this.
...
UniFile uFile = uSession.open ("ORDERS");
UniDataSet datasetRequest = getUnidatasetRequest();
UniDataSet datasetResult = uFile.read(datasetRequest);
...
For most queries this works, but when I try to read an object file (eg SOMEFILE.O
), this read truncates the records within the file. I am thinking that the special characters in the object code are causing problems.
Is there a way to read object code records using UniObjects for Java?
This is what we ended up doing:
I couldn't find a way to make the dataset read the binary code, so I read the items one at a time using a subroutine. Before the items could be read I had to install and run a UniBasic subroutine on the database to encode the item into base 64 using something like this:
This subroutine returned the base 64 encoded item as a
String
to UOJ and then it could be decoded and no data was lost. Here is an example of the Java Code: