> No, our xquery can be simple or complex depend on customer requirement, it is 
> not our control.

So it’s completely another party that is generating the client queries?

> but in case of db:open xquery, we need to know database name much before. 
> where as in doc(...) xquery, no need to pass database name as part of xquery.

By default, your database must be contained in the path argument of
fn:doc call as well. By enabling the DEFAULTDB option, however, your
path will first be resolved against a database that has been opened in
the global context. See [1] for more information on accessing
databases resources with BaseX.

> XQPreparedExpression xqPreparedExpr = null;
> XQResultSequence resultSeq = null;
> xqPreparedExpr = m_conn.prepareExpression(xQuery);
> resultSeq = xqPreparedExpr.executeQuery();
>
> running doc(...) xquery using above java program is working fine, if we open 
> basexgui.bat and open database in GUI. otherwise throw error message. Is 
> there any workaround to solve this doc(...) xquery.

Charles Foster may have enabled the DEFAULTDB option in his driver, so
that may be the reason why XQJ deviates from the standard behavior of
BaseX.

[1] https://docs.basex.org/wiki/Databases

Reply via email to