Problem with true/false function PostgreSQL
Hi.
I have this error while trying to assign to a data variable(BOOLEAN) created at the pool level, true/false value from a postgreSQL function (returns BOOLEAN).
Caused by: org.bonitasoft.engine.expression.exception.SInvalidExpressionException: Declared return type class java.lang.Boolean is not compatible with evaluated type class org.postgresql.jdbc4.Jdbc4ResultSet for expression resultset
I've set my connector output as resultset and return type as java.lang.boolean. Whenever I want to assign to a data variable (LIST) the value of the resultset I use BonitaDBTools in order to obtain the list from the resultset. Is there something similar for this case?
Thanks in advance for any help.
Hello, the connector return a ResultSet. If you want to assign a BOOLEAN, you have to write the Groovy script to search the information from the resultset. I assume your request return one row, and in this row, you have only one columns where your boolean is saved. So, your groovy should be something like boolean myBoolean=false; if (resultSet.next()) { myBoolean = resultSet.getBoolean("NameOfTheSqlColumn"); } resultSet.close(); return myBoolean;