**Please check the edit at the bottom of this post
I have a bytebuffer[128 bits] [which has numbers] which I need to convert to bigdecimal, binary, string since these are the corresponding sql mapping while using jdbc.
Is there a library API that I can make use of to do this. I see String.valueof() does not take a byte array as a parameter.So I am stuck to doing something like this:
BigDecimal bd = new BigDecimal(bigmyBuffer.asCharBuffer().toString());
This looks like a hack to me ?. Is there a better way of doing this or rather doing the jdbc part in an efficient manner. I am focused on doing inserts in the respective sql columns as of now.
Edit:
I was wrong , the bytebuffers were not just numbers but all sort of bits. So now I need to take the 128 bit byte buffer and convert it to 2 longs and then merge to a bigdecimal so that the numbers maintain their sanity. So something like this:
LongBuffer lbUUID = guid.asLongBuffer();
firstLong= lbUUID.get();
secondLong = lbUUID.get();
BigDecimal = firstLong + secondLong ;
Thanks.