The following MySQL queries are equivalent:
select * from TableA where (column1, column2) in ( ('name1', 60), ('name2', 65) )
select * from TableA where (column1='name1' and column2=60) or (column1='name2' and column2=65)
However, the power of the Row Constructor form (ie 1st example) is that you can use it to leverage to handle querying an any length list of pairs of values. Without it you have to write dynamic sql which is a security risk. Using the first form avoids that nasty problem.
However, how do you represent this in JDBC using prepared statemtents? For example:
Connection connection = ...
PreparedStatement smt = connection.preparedStatement("select * from TableA where (column1,column2) in ?");
smt.setObject(1, whatDataTypeGoesHere );
smt.execute();
I've looked into setArray, but how to represent the column1 and column2 values in the values of the array? I'm wondering if SQLData interface might serve as that conduit. But reading the docs I can't see how that might work.