Details
-
Bug
-
Status: Closed (View Workflow)
-
Major
-
Resolution: Fixed
-
1.5.5, 1.5.7
-
None
-
JDK 1.8.0.25
Windows Server 2012
MariaDB 10.1.19
JPA 2.1.0
Description
We have a stored procedure called by Java using JPA:
StoredProcedureQuery storedProcedure = em.createStoredProcedureQuery(EXPORT_PROCEDURE_NAME);
storedProcedure.registerStoredProcedureParameter(OUTPUT_ATTRIBUT_NAME, String.class, ParameterMode.OUT);
storedProcedure.execute();
String jsonResult = (String) storedProcedure.getOutputParameterValue(OUTPUT_ATTRIBUT_NAME);
The last line raises an error:
java.lang.ClassCastException: [B cannot be cast to java.lang.String.
The output of our stored procedure is a string containing JSON formatted data looking like this: [
]
Here is the header of the "show create procedure" query:
STRICT_TRANS_TABLES,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION | CREATE DEFINER=`xxxx`@`localhost` PROCEDURE `EXPORT_TRANSFER_ALL`(OUT json_result TEXT)
This error seems similar is similar to the one reported here: https://mariadb.atlassian.net/browse/CONJ-28
It seems that we're receiving a byte array instead of string though we're not using a secured connexion to the database.