2
I have the following string in format json:
{
"ADT":"0",
"CHD":"0",
"INF":"0"
}
I need to do the Insert in a table on mysql database and retrieve it in Java. I’m using VARCHAR(50) and it looks like this:
{
"ADT":"0",
"CHD":"0",
"INF":"0"
I saw that in Mysql you have the type of field that is called Blob, used for binaries, but not understood how to recover in Java.
Depending on the size, it can be a varchar column or even text.
– user7261
Okay, thanks I’ll try the text
– Fabio Macedo
You can retrieve Blob as a byte array.
– Cold
Postgresql has a wide variety of column types, including XML and JSON. Mysql, as far as I know, is just text and blob.
– user7261
You can put only the string itself and then add the {} keys in java or use some stringfy command.
– Marcelo Gomes