![]() | |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
I am trying to convert an older PG database where we stored GUIDs by explicitly converting them to byte arrays before storing them in the DB to a database where we use the new UUID type supported by PG 8.3. I am having trouble setting such a value through a JDBC PreparedStatement because any stmt.setXXX(i,...) I have tried results in an error about a mismatch between type UUID and XXX. How can I get my PreparedStatement to work correctly? |
#3
| |||
| |||
|
|
I am trying to convert an older PG database where we stored GUIDs by explicitly converting them to byte arrays before storing them in the DB to a database where we use the new UUID type supported by PG 8.3. I am having trouble setting such a value through a JDBC PreparedStatement because any stmt.setXXX(i,...) I have tried results in an error about a mismatch between type UUID and XXX. How can I get my PreparedStatement to work correctly? |
#4
| |||
| |||
|
|
I am trying to convert an older PG database where we stored GUIDs by explicitly converting them to byte arrays before storing them in the DB to a database where we use the new UUID type supported by PG 8.3. I am having trouble setting such a value through a JDBC PreparedStatement because any stmt.setXXX(i,...) I have tried results in an error about a mismatch between type UUID and XXX. How can I get my PreparedStatement to work correctly? |
#5
| |||
| |||
|
|
I am trying to convert an older PG database where we stored GUIDs by explicitly converting them to byte arrays before storing them in the DB to a database where we use the new UUID type supported by PG 8.3. I am having trouble setting such a value through a JDBC PreparedStatement because any stmt.setXXX(i,...) I have tried results in an error about a mismatch between type UUID and XXX. How can I get my PreparedStatement to work correctly? |
#6
| |||
| |||
|
|
I am trying to convert an older PG database where we stored GUIDs by explicitly converting them to byte arrays before storing them in the DB to a database where we use the new UUID type supported by PG 8.3. I am having trouble setting such a value through a JDBC PreparedStatement because any stmt.setXXX(i,...) I have tried results in an error about a mismatch between type UUID and XXX. How can I get my PreparedStatement to work correctly? |
#7
| |||
| |||
|
|
I am trying to convert an older PG database where we stored GUIDs by explicitly converting them to byte arrays before storing them in the DB to a database where we use the new UUID type supported by PG 8.3. I am having trouble setting such a value through a JDBC PreparedStatement because any stmt.setXXX(i,...) I have tried results in an error about a mismatch between type UUID and XXX. How can I get my PreparedStatement to work correctly? |
#8
| |||
| |||
|
|
I am trying to convert an older PG database where we stored GUIDs by explicitly converting them to byte arrays before storing them in the DB to a database where we use the new UUID type supported by PG 8.3. I am having trouble setting such a value through a JDBC PreparedStatement because any stmt.setXXX(i,...) I have tried results in an error about a mismatch between type UUID and XXX. How can I get my PreparedStatement to work correctly? |
#9
| |||
| |||
|
|
I am trying to convert an older PG database where we stored GUIDs by explicitly converting them to byte arrays before storing them in the DB to a database where we use the new UUID type supported by PG 8.3. I am having trouble setting such a value through a JDBC PreparedStatement because any stmt.setXXX(i,...) I have tried results in an error about a mismatch between type UUID and XXX. How can I get my PreparedStatement to work correctly? |
#10
| |||
| |||
|
|
Silvio Bierman <sbierman (AT) jambo-software (DOT) com> wrote: I am trying to convert an older PG database where we stored GUIDs by explicitly converting them to byte arrays before storing them in the DB to a database where we use the new UUID type supported by PG 8.3. I am having trouble setting such a value through a JDBC PreparedStatement because any stmt.setXXX(i,...) I have tried results in an error about a mismatch between type UUID and XXX. How can I get my PreparedStatement to work correctly? Since there are no type casts for uuid, the only way I can see is to use a string and explicitly cast this string (type "unknown") to uuid. java.sql.PreparedStatement stmt = conn.prepareStatement("UPDATE tab SET uid = ?::uuid WHERE ..."); stmt.setString(1, "a0eebc99-9c0b-4ef8-bb6d-6bb9bd380a11"); stmt.executeUpdate(); You would somehow have to convert your GUIDs to the format above. Yours, Laurenz Albe |
![]() |
| Thread Tools | |
| Display Modes | |
| |