I am using Marklogic Optic Java API as follows :-
ModifyPlan plan = p.fromView(SchemaName, ViewName)
.where(p.eq(p.col("COL1"), strColValue))
.select(colSeq);
Now I have list of data & I need use "WHERE IN" clause for this query.
select * from table where col in ('val1', 'val2'.....,'valn');
Could anyone please tell me how to do this using marklogic Java API.
Thanks & Regards,
Renuka Patil
One way to use SQL on Marklogic DB using Java is JDBC.You can perform following steps:
Download JDBC driver from: https://jdbc.postgresql.org/download/postgresql-42.1.4.jar & Reference it in your Java Project.
Setup ODBC server on Marklogic DB as described in : https://docs.marklogic.com/guide/admin/odbc (Remember to select your correct DB in this step & for this example, change Auth type to Basic)
Sample Java code can be as follow:
Note:
Hope it helps you :-)