oracle.sql.Blob to JsonObject

174 views
Skip to first unread message

Maral-Erdene Tumursuh

unread,
Dec 4, 2020, 11:37:51 PM12/4/20
to vert.x

Hi guys, I tried to put Blob file to JsonObject like this,
JsonObject resultObject;
        ResultSet result = (ResultSet) statement.getObject(1);
         resultObject.put("attributeName",result.getBlob(1));

But faced this error.
java.lang.IllegalStateException: Illegal type in JsonObject: class oracle.sql.BLOB

How to set Blob file to JsonObject.

thanks in advance.

Julien Viet

unread,
Dec 14, 2020, 3:13:10 AM12/14/20
to vert.x
Hi,

you should convert it to a Vert.x Buffer.

Julien

--
You received this message because you are subscribed to the Google Groups "vert.x" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vertx+un...@googlegroups.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/vertx/2bccf5ae-0d3f-46e4-aad5-00bbc33d2573n%40googlegroups.com.

Paulo Lopes

unread,
Dec 17, 2020, 3:52:04 AM12/17/20
to vert.x
Hi, now that vert.x 4.0.0 is released, I'd recommend you to look at the new "sql-client" API. This API allows the usage of all JDBC types, not only JSON.

Reply all
Reply to author
Forward
0 new messages