How to save a UUID as binary(16) in java
问题 I have a table TestTable with columns ID as binary(16) and name as varchar(50) I've been trying to store an ordered UUID as PK like in this article Store UUID in an optimized way I see the UUID is saved in database as HEX (blob) So I want to save this ID from java but I am getting this error Data truncation: Data too long for column 'ID' at row 1 I am currently using the library sql2o to interact with mysql So basically this is my code String suuid = UUID.randomUUID().toString(); String