So it’s completely another party that is generating the client queries? Srikumar>> yes it is another component, which generate query, we do not have control on it.
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. Srikumar>> yes if I will modify the doc xquery and passed database name, it is working fine. For example: for $article in doc('JunitDocbaseDB/6301904f80000114/0601904f80007547.xml') return $article"
I will try one more option like open database just before running xquery. java code: ======== String xQuery = "for $article in doc('6301904f80000114/0601904f80007547.xml') return $article";
xqPreparedExpr = m_conn.prepareExpression(xQuery); xqPreparedExpr.executeCommand("OPEN " + "JunitDocbaseDB"); resultSeq = xqPreparedExpr.executeQuery();
Thanks, Srikumar
________________________________ From: Christian Grün christian.gruen@gmail.com Sent: Tuesday, August 18, 2020 3:18 PM To: Srikumar Choudhury schoudhu@opentext.com Cc: basex-talk@mailman.uni-konstanz.de basex-talk@mailman.uni-konstanz.de; Nikhil Sethi nsethi@opentext.com Subject: Re: [EXTERNAL] - Re: Error: Stopped at ., 1/20: [FODC0002] Resource 'C:/Srikumar/Software/BaseX/BaseX941/basex/bin/6301904f80000114/0601904f80007547.xml' does not exist.
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://urldefense.com/v3/__https://docs.basex.org/wiki/Databases__;!!Obbck6...