[MonetDB-users] [XQuery] Communicate with Java?
Dear all, I'm a totally newbie and try to implements an LDAP-application over MonetDB/XQuery due to efficient search performance of column-store. Like the example XQueryLoad.java does i have succeed to import a XML-file and now come my questions: * How can i manipulate my XML-files with JAVA? Like doing searches and changes over XML-files. * How is the performance of Subtree-search? Like doing searchs over the whole tree or any subtrees. As once discussed in http://comments.gmane.org/gmane.comp.db.monetdb.user/1027, i'm in the same situation. Best regards, Chaojing Yang -- ------------------------------------------------------------------------------------------------------------------------------------------ Email: chaojing.yang@gmail.com Blog: http://goethe-ist-taoist.blogspot.com/ §1 Ich widerspreche der Nutzung oder Übermittlung meiner Daten für Werbezwecke oder sowie andere unbefugte Verwendungszwecke. (§ 28 Abs. 4 BDSG=Bundesdatenschutzgesetz). §2 Durch die Datenübertragung bzw. Kommunikation per E-Mail liegt ein Verstoß gegen das BDSG vor, da ihre Daten insoweit nicht ausreichend geschützt sind. Ich bitte Sie daher, mir schriftlich zu bestätigen, dass Sie mit dem Verstoß gegen das BDSG einverstanden sind und keine Schadensersatzanspräche bzw. Unterlassungsanspräche mir gegenüber geltend machen. §3 Der Inhalt dieser Nachricht ist vertraulich und nur für den oben angegebenen Empfänger bestimmt.
Hi,
thank you for using monetdb. Answers follow:)
2008/8/4 Chaojing Yang
Dear all,
I'm a totally newbie and try to implements an LDAP-application over MonetDB/XQuery due to efficient search performance of column-store. Like the example XQueryLoad.java does i have succeed to import a XML-file and now come my questions:
How can i manipulate my XML-files with JAVA? Like doing searches and changes over XML-files.
If I understood correct, you load your xml documents in monet. So the next step is to send the relevant xquery queries to monet using the jdbc drivers and wait for the result:) If you are talking about manipulating some xml data inside java then you would use the main memory representation DOM provided by the standard java library.
How is the performance of Subtree-search? Like doing searchs over the whole tree or any subtrees.
I think you will be satisfied by the response time of Monetdb:) However, it has to do with what you will be searching and what your queries will be doing. I would suggest to test some queries with the monet client (command: mclient -lxq) to see for your self.
As once discussed in http://comments.gmane.org/gmane.comp.db.monetdb.user/1027, i'm in the same situation.
This thread is about monetdb5 and mal, while you will be using monetdb 4 (using mil) and xquery (I dont believe you have to get "dirty" with mil though). Hope i could help. lefteris
Best regards, Chaojing Yang
-- ------------------------------------------------------------------------------------------------------------------------------------------ Email: chaojing.yang@gmail.com Blog: http://goethe-ist-taoist.blogspot.com/
§1 Ich widerspreche der Nutzung oder Übermittlung meiner Daten für Werbezwecke oder sowie andere unbefugte Verwendungszwecke. (§ 28 Abs. 4 BDSG=Bundesdatenschutzgesetz).
§2 Durch die Datenübertragung bzw. Kommunikation per E-Mail liegt ein Verstoß gegen das BDSG vor, da ihre Daten insoweit nicht ausreichend geschützt sind. Ich bitte Sie daher, mir schriftlich zu bestätigen, dass Sie mit dem Verstoß gegen das BDSG einverstanden sind und keine Schadensersatzanspräche bzw. Unterlassungsanspräche mir gegenüber geltend machen.
§3 Der Inhalt dieser Nachricht ist vertraulich und nur für den oben angegebenen Empfänger bestimmt.
------------------------------------------------------------------------- This SF.Net email is sponsored by the Moblin Your Move Developer's challenge Build the coolest Linux based applications with Moblin SDK & win great prizes Grand prize is a trip for two to an Open Source event anywhere in the world http://moblin-contest.org/redirect.php?banner_id=100&url=/ _______________________________________________ MonetDB-users mailing list MonetDB-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/monetdb-users
Hi,
I'm a totally newbie and try to implements an LDAP-application over MonetDB/XQuery due to efficient search performance of column-store. Like the example XQueryLoad.java does i have succeed to import a XML-file and now come my questions:
How can i manipulate my XML-files with JAVA? Like doing searches and changes over XML-files.
If I understood correct, you load your xml documents in monet. So the next step is to send the relevant xquery queries to monet using the jdbc drivers and wait for the result:) If you are talking about manipulating some xml data inside java then you would use the main memory representation DOM provided by the standard java library.
That really turns me a light through the darkness, thanks a lot 8-) Have never thought that xquery works through jdbc. I tried lots of xqueries, it works nice. One thing to mention, if i try query which means not a search activity, will cause an Exception. But it works...anyway, the insert action has been done. For examples: * rs = st.executeQuery("do insert <end/> as last into doc(\"greetings.xml\")/doc"); o Exception in thread "main" java.sql.SQLException: ?Z{TP?[P?ZP?[?Z?ZP?[V ( Mars language... ) at nl.cwi.monetdb.jdbc.MonetConnection$ResponseList.executeQuery(MonetConnection.java:2048) at nl.cwi.monetdb.jdbc.MonetConnection$ResponseList.processQuery(MonetConnection.java:1798) at nl.cwi.monetdb.jdbc.MonetStatement.internalExecute(MonetStatement.java:371) at nl.cwi.monetdb.jdbc.MonetStatement.execute(MonetStatement.java:340) at nl.cwi.monetdb.jdbc.MonetStatement.executeQuery(MonetStatement.java:404) at test.monetdb.XQuerySearch.main(XQuerySearch.java:46) Now i'm wondering, if jdbc also support prepared query, which means to execute query like this: * rs = st.executeQuery("prepared.xq" , "var1" , "var2" ... );
How is the performance of Subtree-search? Like doing searchs over the whole tree or any subtrees.
I think you will be satisfied by the response time of Monetdb:) However, it has to do with what you will be searching and what your queries will be doing. I would suggest to test some queries with the monet client (command: mclient -lxq) to see for your self.
run: mclient -lx -t q.xq I get Error: Can't find zlib1.dll Reinstall didn't solve the problem.
As once discussed in http://comments.gmane.org/gmane.comp.db.monetdb.user/1027, i'm in the same situation.
This thread is about monetdb5 and mal, while you will be using monetdb 4 (using mil) and xquery (I dont believe you have to get "dirty" with mil though).
That's the best news of this week and thank lefteris, u words do helped me a lot. Best regards, Chaojing Yang
Hi,
On Wed, Aug 6, 2008 at 11:36 PM, Chaojing Yang
One thing to mention, if i try query which means not a search activity, will cause an Exception. But it works...anyway, the insert action has been done. For examples:
rs = st.executeQuery("do insert <end/> as last into doc(\"greetings.xml\")/doc");
Exception in thread "main" java.sql.SQLException: ?Z {T P?[ P?Z P?[ ?Z ?Z P?[ V ( Mars language... ) at nl.cwi.monetdb.jdbc.MonetConnection$ResponseList.executeQuery(MonetConnection.java:2048) at nl.cwi.monetdb.jdbc.MonetConnection$ResponseList.processQuery(MonetConnection.java:1798) at nl.cwi.monetdb.jdbc.MonetStatement.internalExecute(MonetStatement.java:371) at nl.cwi.monetdb.jdbc.MonetStatement.execute(MonetStatement.java:340) at nl.cwi.monetdb.jdbc.MonetStatement.executeQuery(MonetStatement.java:404) at test.monetdb.XQuerySearch.main(XQuerySearch.java:46)
I am not sure what is this, but maybe some more experts than me in jdbc can answer?
Now i'm wondering, if jdbc also support prepared query, which means to execute query like this:
rs = st.executeQuery("prepared.xq" , "var1" , "var2" ... );
I am not sure if there is a method with such a signature, but you can always wrap your file with an inputStream object and create the string yourself. This can be done either inline or you can always overload the executeQuery method to accept a string and do your IO management inside the overloaded method. letferis
run: mclient -lx -t q.xq
I get Error: Can't find zlib1.dll Reinstall didn't solve the problem.
It looks like you are missing the zlib library. Try installing the zlib from here: http://www.winimage.com/zLibDll/ (the precompiled dll package) and it should work.
As once discussed in http://comments.gmane.org/gmane.comp.db.monetdb.user/1027, i'm in the same situation.
This thread is about monetdb5 and mal, while you will be using monetdb 4 (using mil) and xquery (I dont believe you have to get "dirty" with mil though).
That's the best news of this week and thank lefteris, u words do helped me a lot.
Best regards, Chaojing Yang
------------------------------------------------------------------------- This SF.Net email is sponsored by the Moblin Your Move Developer's challenge Build the coolest Linux based applications with Moblin SDK & win great prizes Grand prize is a trip for two to an Open Source event anywhere in the world http://moblin-contest.org/redirect.php?banner_id=100&url=/ _______________________________________________ MonetDB-users mailing list MonetDB-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/monetdb-users
On 07-08-2008 10:21:20 +0200, Lefteris wrote:
Exception in thread "main" java.sql.SQLException: ?Z {T P?[ P?Z P?[ ?Z ?Z P?[ V ( Mars language... )
I am not sure what is this, but maybe some more experts than me in jdbc can answer?
My Marsian isn't to good either :(
Now i'm wondering, if jdbc also support prepared query, which means to execute query like this:
rs = st.executeQuery("prepared.xq" , "var1" , "var2" ... );
I am not sure if there is a method with such a signature, but you can always wrap your file with an inputStream object and create the string yourself. This can be done either inline or you can always overload the executeQuery method to accept a string and do your IO management inside the overloaded method.
Be aware that the JDBC functionality is very fragile and limited. MonetDB/XQuery has no good interfacing, and hence JDBC's support is nothing more but a convenience hack that can and will break as soon as you want anything more complicated than the answer of something like "1 + 1" (the usual test query).
On Thu, Aug 7, 2008 at 10:27 AM, Fabian Groffen
On 07-08-2008 10:21:20 +0200, Lefteris wrote:
Exception in thread "main" java.sql.SQLException: ?Z {T P?[ P?Z P?[ ?Z ?Z P?[ V ( Mars language... )
I am not sure what is this, but maybe some more experts than me in jdbc can answer?
My Marsian isn't to good either :(
Now i'm wondering, if jdbc also support prepared query, which means to execute query like this:
rs = st.executeQuery("prepared.xq" , "var1" , "var2" ... );
I am not sure if there is a method with such a signature, but you can always wrap your file with an inputStream object and create the string yourself. This can be done either inline or you can always overload the executeQuery method to accept a string and do your IO management inside the overloaded method.
Be aware that the JDBC functionality is very fragile and limited. MonetDB/XQuery has no good interfacing, and hence JDBC's support is nothing more but a convenience hack that can and will break as soon as you want anything more complicated than the answer of something like "1 + 1" (the usual test query).
You can always use XRPC http://monetdb.cwi.nl/XQuery/Documentation/Using-XRPC-from-Java.html
------------------------------------------------------------------------- This SF.Net email is sponsored by the Moblin Your Move Developer's challenge Build the coolest Linux based applications with Moblin SDK & win great prizes Grand prize is a trip for two to an Open Source event anywhere in the world http://moblin-contest.org/redirect.php?banner_id=100&url=/ _______________________________________________ MonetDB-users mailing list MonetDB-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/monetdb-users
On Thu, Aug 07, 2008 at 10:33:00AM +0200, Lefteris wrote:
On Thu, Aug 7, 2008 at 10:27 AM, Fabian Groffen
wrote: On 07-08-2008 10:21:20 +0200, Lefteris wrote:
Exception in thread "main" java.sql.SQLException: ?Z {T P?[ P?Z P?[ ?Z ?Z P?[ V ( Mars language... )
I am not sure what is this, but maybe some more experts than me in jdbc can answer?
My Marsian isn't to good either :(
Now i'm wondering, if jdbc also support prepared query, which means to execute query like this:
rs = st.executeQuery("prepared.xq" , "var1" , "var2" ... );
I am not sure if there is a method with such a signature, but you can always wrap your file with an inputStream object and create the string yourself. This can be done either inline or you can always overload the executeQuery method to accept a string and do your IO management inside the overloaded method.
Be aware that the JDBC functionality is very fragile and limited. MonetDB/XQuery has no good interfacing, and hence JDBC's support is nothing more but a convenience hack that can and will break as soon as you want anything more complicated than the answer of something like "1 + 1" (the usual test query).
You can always use XRPC
http://monetdb.cwi.nl/XQuery/Documentation/Using-XRPC-from-Java.html
The whole story about XRPC can be found here: http://monetdb.cwi.nl/XQuery/Documentation/XRPC-Extension.html
------------------------------------------------------------------------- This SF.Net email is sponsored by the Moblin Your Move Developer's challenge Build the coolest Linux based applications with Moblin SDK & win great prizes Grand prize is a trip for two to an Open Source event anywhere in the world http://moblin-contest.org/redirect.php?banner_id=100&url=/ _______________________________________________ MonetDB-users mailing list MonetDB-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/monetdb-users
------------------------------------------------------------------------- This SF.Net email is sponsored by the Moblin Your Move Developer's challenge Build the coolest Linux based applications with Moblin SDK & win great prizes Grand prize is a trip for two to an Open Source event anywhere in the world http://moblin-contest.org/redirect.php?banner_id=100&url=/ _______________________________________________ MonetDB-users mailing list MonetDB-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/monetdb-users
Dear all, Do someone now how to monitor the communications between XQuery-Client and XQuery-Server. It seems using ServerSocket, which cann't be monitored with tcpmon. https://tcpmon.dev.java.net/ I assume that XQuery-Server uses default port 50000 and XQuery-Client uses port which is assigned by need. Best regards, Chaojing Yang -- ------------------------------------------------------------------------------------------------------------------------------------------ Email: chaojing.yang@gmail.com Blog: http://goethe-ist-taoist.blogspot.com/ §1 Ich widerspreche der Nutzung oder Übermittlung meiner Daten für Werbezwecke oder sowie andere unbefugte Verwendungszwecke. (§ 28 Abs. 4 BDSG=Bundesdatenschutzgesetz). §2 Durch die Datenübertragung bzw. Kommunikation per E-Mail liegt ein Verstoß gegen das BDSG vor, da ihre Daten insoweit nicht ausreichend geschützt sind. Ich bitte Sie daher, mir schriftlich zu bestätigen, dass Sie mit dem Verstoß gegen das BDSG einverstanden sind und keine Schadensersatzanspräche bzw. Unterlassungsanspräche mir gegenüber geltend machen. §3 Der Inhalt dieser Nachricht ist vertraulich und nur für den oben angegebenen Empfänger bestimmt.
Hello, It should be possible to execute XQUF statements through JDBC. It can be done by using the Statement's executeUpdate() method instead of the executeQuery() method. The executeUpdate() method should be used in all cases where there is no result set expected (so all queries using XQUF). As Fabian mentioned: the JDBC interface is indeed a hack, but as long as your query results are small, then it should work fine. At least that's what I experienced. Hope this helps, Wouter -----Original Message----- From: monetdb-users-bounces@lists.sourceforge.net [mailto:monetdb-users-bounces@lists.sourceforge.net] On Behalf Of Fabian Groffen Sent: donderdag 7 augustus 2008 10:28 To: monetdb-users@lists.sourceforge.net Subject: Re: [MonetDB-users] [XQuery] Communicate with Java? On 07-08-2008 10:21:20 +0200, Lefteris wrote:
Exception in thread "main" java.sql.SQLException: ?Z {T P?[ P?Z P?[ ?Z ?Z P?[ V ( Mars language... )
I am not sure what is this, but maybe some more experts than me in jdbc can answer?
My Marsian isn't to good either :(
Now i'm wondering, if jdbc also support prepared query, which means to execute query like this:
rs = st.executeQuery("prepared.xq" , "var1" , "var2" ... );
I am not sure if there is a method with such a signature, but you can always wrap your file with an inputStream object and create the string yourself. This can be done either inline or you can always overload the executeQuery method to accept a string and do your IO management inside the overloaded method.
Be aware that the JDBC functionality is very fragile and limited. MonetDB/XQuery has no good interfacing, and hence JDBC's support is nothing more but a convenience hack that can and will break as soon as you want anything more complicated than the answer of something like "1 + 1" (the usual test query). ------------------------------------------------------------------------- This SF.Net email is sponsored by the Moblin Your Move Developer's challenge Build the coolest Linux based applications with Moblin SDK & win great prizes Grand prize is a trip for two to an Open Source event anywhere in the world http://moblin-contest.org/redirect.php?banner_id=100&url=/ _______________________________________________ MonetDB-users mailing list MonetDB-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/monetdb-users
participants (5)
-
Chaojing Yang
-
Fabian Groffen
-
Lefteris
-
Wouter Alink
-
Ying Zhang