I have an Image object and I want to take it to byte[].
Image image a byte[] imageByte;
I have an Image object and I want to take it to byte[].
Image image a byte[] imageByte;
I have a table with two fields:
id int NOT NULL AUTO_INCREMENT,
nombre varchar(20) NOT NULL DEFAULT ''
and a script with the following insert:
INSERT INTO articulos VALUES (21,"Accesorio Derivación");
The script is in a text file with UTF8 encoding.
My problem occurs when from the MySQL console I try to run the script with:
source archivo.sql;
It gives me the error "ERROR 1406 (22001): Data too long for column 'name' at row 1".
What it does is replace the "ó" with "├│" and there remains a longer character, 21 long, that's why it gives the error.
I have the base and the table defined with:
DEFAULT CHARACTER SET utf8mb4
If I execute the same insert from a QueryTab of the Workbench, it works correctly taking the characters.
How can I get the characters correctly from the script and fix this problem??? Even adding some function on the string in the insert like CONVERT would help me.
When I DUMP a table in MySQL, if it has a blob field, it generates an INSERT with the following format:
INSERT INTO `fotos` VALUES (1,73,_binary 'ÿ\Øÿ\à\0JFIF\....')
I would like my application to generate that INSERT command to perform my own DUMP from my java application.
My question is how do I get the binary string that goes after the _binary from a ResultSet that gives me the statement.executeQuery(sql) ??
I get to get the blob of the field:
Blob blob = resultSet.getBlob(i);
but I don't know how to get the string I need from there.
I have a table A with the records: A, B, C I have another table B with the records: 4, 2, 1 I need to get a list with the combined records: A 4, A 2, A 1, B 4, B 2, B 1, C 4, C 2, C 1 How would a SELECT be to obtain this?