I found the solution for my second question.
We can use ${xxx} in the SQL of Adapter service instead of ?.
e.g.
The SQL in the Adapter service:
SELECT * FROM (${inSql})
The input parameter:
“SELECT a, b, c FROM table1 WHERE d = 1”
The SQL run will become SELECT * FROM ( SELECT a, b, c FROM table1 WHERE d = 1)