byte[16]JDBCから16バイトの配列()を読み取っていますResultSetがrs.getBytes("id")、これを2つの長い値に変換する必要があります。どうやってやるの?
これは私が試したコードですが、おそらくByteBuffer正しく使用していませんでした。
byte[] bytes = rs.getBytes("id");
System.out.println("bytes: "+bytes.length); // prints "bytes: 16"
ByteBuffer buffer = ByteBuffer.allocate(16);
buffer = buffer.put(bytes);
// throws an java.nio.BufferUnderflowException
long leastSignificant = buffer.getLong();
long mostSignificant = buffer.getLong();
次を使用してバイト配列をデータベースに保存しました。
byte[] bytes = ByteBuffer.allocate(16)
.putLong(leastSignificant)
.putLong(mostSignificant).array();