1

We are using eclipse link 2.4 with postgres 9.2.4 There is no functionality problem with UUID. However, I see that when JDBC executes selects, the values are returned as string from the database..(i see that in the ResultSet). Which is not efficient since postgres have to convert it from UUID to string and then converting back from String to UUID in the Java application.. and the fromString of UUID is not efficient at all. I can fix the fromString but it makes much more sense to receive the UUID as binary in the first place.. Is there any way of transferring the UUID as byte array? I do see this code in postgres 9.4 JDBC driver :

if (type.equals("uuid")) {
    if (isBinary(columnIndex)) {
        return getUUID(this_row[columnIndex - 1]);
    }
    return getUUID(getString(columnIndex));
}

Which means there is support for binary UUIDS. I just can can the frickin driver to work with binary UUIDs. I get them as string.. Any idea? Thanks

2
  • Postgres JDBC driver seems to support UUIDs (check out this and this). Could be that eclipselink is the problem. Commented Jul 27, 2016 at 15:13
  • @PredragMaric thanks, actually i debugged it more and i noticed that sometimes i get binary UUID , sometimes text. It seems that if the statement is not prepared, we get text. (according to postgres protocol documentation, it indeed doesnt support binary format for unprepared statements) Commented Aug 1, 2016 at 11:37

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.