vertx-jdbc-client
vertx-jdbc-client copied to clipboard
Support for storing binary data to blob
Version
- vert.x core: 3.4.1
- vert.x jdbc-client: 3.4.1
General info
- RDBMS server : MySQL
Context
JsonArray jsonArray = new JsonArray().add(new byte[]{0x00, 0x01, 0x03});
conn.queryWithParams(storeSql, jsonArray, res -> { } );
-
Currently, the byte[] data will be encoded by Base64 and stored to blob. It bring extra effort to encoding and decoding the string.
-
JsonArray doesn't support binary data, the support for blob should also be improved (getBlob()).
The JDBCStatementHelper can take clobs and blobs. What would be useful is to add SQLConnection.createBlob() and sqlConnection.createClob() which call the underlying connection as these are often created using the underlying SQL Connection
Actually just spotted the unwrap() method. I.e. you can use Blobs and Clobs in these queryParams connection.unwrap().createBlob()...
Clobs/blobs are automatically freed when added to the statement.