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

paranoidAndroid
  • 523
  • 5
  • 12
  • Postgres JDBC driver seems to support UUIDs (check out [this](http://crafted-software.blogspot.rs/2013/03/uuid-values-from-jdbc-to-postgres.html) and [this](http://stackoverflow.com/questions/17969431/postgres-uuid-jdbc-not-working)). Could be that eclipselink is the problem. – Predrag Maric Jul 27 '16 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) – paranoidAndroid Aug 01 '16 at 11:37

0 Answers0