We have procedures that run in MySQL and that return multiple result sets.
When build unit tests for them and using H2, I am unable to properly get a
return from H2. If the procedure returns either an array of ResultSet or
List<ResultSet>, both get wrapped in another array list instead of just
returning the array/list of results.
The end result is that we can't use the return since it is different data
returned back vs that from going straight to the MySQL database. Am I
missing something here?
Example Procedure:
CREATE ALIAS getData AS $$
import java.sql.*;
import java.util.*;
import org.h2.tools.SimpleResultSet;
@CODE
List<ResultSet> getData(Connection conn, Integer clientId) {
SimpleResultSet client = new SimpleResultSet();
client.addColumn("id", Types.INTEGER, 10, 0);
client.addColumn("name", Types.VARCHAR, 255, 0);
SimpleResultSet conditions = new SimpleResultSet();
conditions.addColumn("clientId", Types.INTEGER, 10, 0);
conditions.addColumn("conditionId", Types.INTEGER, 10, 0);
conditions.addColumn("conditionName", Types.VARCHAR, 255, 0);
if (clientId > 0) {
spaces.addRow(100, "test-client");
conditions.addRow(100, 999, "test_condition");
}
return Arrays.asList(client, conditions);
}
$$;
--
You received this message because you are subscribed to the Google Groups "H2
Database" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/h2-database.
For more options, visit https://groups.google.com/d/optout.