[MonetDB-users] Accessing MonetDB with MAL through JBDC
Hi folks, I just installed MonetDB. I tried to run the simplest examples and failed. :-( The MAL Reference does not semm really helpful though to me. My questions is, is it possible to use the DB as an embedded server with a Java application? The exampled displayed a C example only. Is it possible to communicate to the server with MAL? I want to write a backend for the Apache Directory Server. I want MonetDB to be it. I want to transform LDAP requests to MAL and get results back form the server. Is this possible at all with this DB? FYI: I am a C illiterate Mike -- <NO> OOXML - Say NO To Microsoft Office broken standard http://www.noooxml.org
On Tue, Feb 05, 2008 at 02:30:21PM +0100, Michael wrote:
Hi folks,
I just installed MonetDB. I tried to run the simplest examples and failed. :-( The MAL Reference does not semm really helpful though to me.
My questions is, is it possible to use the DB as an embedded server with a Java application? The exampled displayed a C example only. Is it possible to communicate to the server with MAL?
I want to write a backend for the Apache Directory Server. I want MonetDB to be it. I want to transform LDAP requests to MAL and get results back form the server.
Is this possible at all with this DB? FYI: I am a C illiterate
Interesting project. Using MAL at the java/jdbc layer is however only supported with a fixed set of rules. The most important one being, you have to take care of sending the right 'result sets' from the server, ie sent correct tabular results. Embedding of monetdb is only possible with C code. So if wrapping using jni (or so) is possible then monet could run with java as well. Could you point us to the examples which failed for you, probably we should improve the documentation. Niels
Mike -- <NO> OOXML - Say NO To Microsoft Office broken standard http://www.noooxml.org
------------------------------------------------------------------------- This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2008. http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ _______________________________________________ MonetDB-users mailing list MonetDB-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/monetdb-users
-- Niels Nes, Centre for Mathematics and Computer Science (CWI) Kruislaan 413, 1098 SJ Amsterdam, The Netherlands room C0.02, phone ++31 20 592-4098, fax ++31 20 592-4312 url: http://www.cwi.nl/~niels e-mail: Niels.Nes@cwi.nl
Niels Nes wrote:
On Tue, Feb 05, 2008 at 02:30:21PM +0100, Michael wrote:
Hi folks,
I just installed MonetDB.
what platform? what version?
I tried to run the simplest examples and failed. :-( The MAL Reference does not semm really helpful though to me.
what console are you using? On linux consider the following session trace:
prompt> mserver5 # MonetDB server v5.3.0, based on kernel v1.21.0 # Serving database 'demo' # Compiled for x86_64-unknown-linux-gnu/64bit with 64bit OIDs dynamically linked # Copyright (c) 1993-2007 CWI, all rights reserved # Visit http://monetdb.cwi.nl/ for further information #warning: please don't forget to set your vault key! #(see /ufs/mk/monet5//Linux/etc/monetdb5.conf) # Listening for connection requests on mapi:monetdb://127.0.0.1:50000/
io.print("hello world"); [ "hello world" ]
the source distribution contains hundreds of MAL programs for inspiration.
My questions is, is it possible to use the DB as an embedded server with a Java application? The exampled displayed a C example only. Is it possible to communicate to the server with MAL?
I want to write a backend for the Apache Directory Server. I want MonetDB to be it. I want to transform LDAP requests to MAL and get results back form the server.
Is this possible at all with this DB? FYI: I am a C illiterate
Interesting project. Using MAL at the java/jdbc layer is however only supported with a fixed set of rules. The most important one being, you have to take care of sending the right 'result sets' from the server, ie sent correct tabular results.
Embedding of monetdb is only possible with C code. So if wrapping using jni (or so) is possible then monet could run with java as well.
Could you point us to the examples which failed for you, probably we should improve the documentation.
Niels
Mike -- <NO> OOXML - Say NO To Microsoft Office broken standard http://www.noooxml.org
------------------------------------------------------------------------- This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2008. http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ _______________________________________________ MonetDB-users mailing list MonetDB-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/monetdb-users
Martin Kersten wrote:
Niels Nes wrote:
On Tue, Feb 05, 2008 at 02:30:21PM +0100, Michael wrote:
Hi folks,
I just installed MonetDB.
what platform? what version?
I am on Windows XP, latest MonetDB 5
I tried to run the simplest examples and failed. :-( The MAL Reference does not semm really helpful though to me.
what console are you using?
Tried mclient.exe and the jdbc client.
On linux consider the following session trace:
prompt> mserver5 # MonetDB server v5.3.0, based on kernel v1.21.0 # Serving database 'demo' # Compiled for x86_64-unknown-linux-gnu/64bit with 64bit OIDs dynamically linked # Copyright (c) 1993-2007 CWI, all rights reserved # Visit http://monetdb.cwi.nl/ for further information #warning: please don't forget to set your vault key! #(see /ufs/mk/monet5//Linux/etc/monetdb5.conf) # Listening for connection requests on mapi:monetdb://127.0.0.1:50000/
io.print("hello world"); [ "hello world" ]
The sample above works flawlessly in the server console. Talking MAL through the mclient worked too. But sending io.print("hello"); with JDBC resulted in: Database connect failed: InvalidCredentialsException:checkCredentials:Invalid cr edentials for user 'monetdb' C:\Programme\CWI\MonetDB5\share\MonetDB\lib>java -jar jdbcclient.jar -umonetdb - lmal password: Welcome to the MonetDB interactive JDBC terminal! Type \q to quit, \h for a list of available commands auto commit mode: on monetdb-> io.print("hello"); Error: TypeException:user.main[1]:'ioo.print' undefined in: _1:any := ioo.print( _2:str) monetdb-> -- <NO> OOXML - Say NO To Microsoft Office broken standard http://www.noooxml.org
On 06-02-2008 11:49:49 +0100, Michael wrote:
But sending io.print("hello"); with JDBC resulted in:
Database connect failed: InvalidCredentialsException:checkCredentials:Invalid cr edentials for user 'monetdb'
This means you entered a wrong password (or the authorisation tables are corrupted).
C:\Programme\CWI\MonetDB5\share\MonetDB\lib>java -jar jdbcclient.jar -umonetdb - lmal password:
Your second try appears to work, though.
Welcome to the MonetDB interactive JDBC terminal! Type \q to quit, \h for a list of available commands auto commit mode: on monetdb-> io.print("hello"); Error: TypeException:user.main[1]:'ioo.print' undefined in: _1:any := ioo.print( _2:str) monetdb->
This is really weird. First and foremost this query will never work correctly using JDBC (you will witness JDBC complaining about protocol violations). Please realise that you use an undocumented hack that we cannot support. What really worries me though is the "ioo.print" instead of "io.print", which appears to be entered. Reading your other posts, I don't really understand what you want. While I think anything is better than OpenLDAP, how do you see MonetDB fill in the functionality here? I guess you could simply define some SQL-based database schema to do the LDAP equivalents, but for instance pam_ldap/nss_ldap will expect to speak the LDAP dialect/language, which somehow needs to be mapped onto any language that MonetDB supports. Doing this in Java will not be desirable for the memory footprint involved in doing so. Unless you have completely different objectives here, I think Java is not what you are looking for. I would be very pleased if there would be an LDAP language frontend to MonetDB. That is, MonetDB supporting the ldap and ldaps protocols. Of course the MonetDB that you would use there is a specially compiled/crafted version that has a very low footprint and excludes any functionality that is not necessary, basically just libgdk.
Fabian Groffen wrote:
On 06-02-2008 11:49:49 +0100, Michael wrote:
But sending io.print("hello"); with JDBC resulted in:
Database connect failed: InvalidCredentialsException:checkCredentials:Invalid cr edentials for user 'monetdb'
This means you entered a wrong password (or the authorisation tables are corrupted).
C:\Programme\CWI\MonetDB5\share\MonetDB\lib>java -jar jdbcclient.jar -umonetdb - lmal password:
Your second try appears to work, though.
Welcome to the MonetDB interactive JDBC terminal! Type \q to quit, \h for a list of available commands auto commit mode: on monetdb-> io.print("hello"); Error: TypeException:user.main[1]:'ioo.print' undefined in: _1:any := ioo.print( _2:str) monetdb->
This is really weird. First and foremost this query will never work correctly using JDBC (you will witness JDBC complaining about protocol violations). Please realise that you use an undocumented hack that we cannot support.
What really worries me though is the "ioo.print" instead of "io.print", which appears to be entered.
Reading your other posts, I don't really understand what you want. While I think anything is better than OpenLDAP, how do you see MonetDB fill in the functionality here? I guess you could simply define some SQL-based database schema to do the LDAP equivalents, but for instance pam_ldap/nss_ldap will expect to speak the LDAP dialect/language, which somehow needs to be mapped onto any language that MonetDB supports. Doing this in Java will not be desirable for the memory footprint involved in doing so. Unless you have completely different objectives here, I think Java is not what you are looking for.
I would be very pleased if there would be an LDAP language frontend to MonetDB. That is, MonetDB supporting the ldap and ldaps protocols. Of course the MonetDB that you would use there is a specially compiled/crafted version that has a very low footprint and excludes any functionality that is not necessary, basically just libgdk.
Hi Fabian, what you write seems quite reasonable. My base idea was to provide another backend to the Apache Directory Server which could talk directly through MAL. Since you guys replied really quickly, I am aware now that it isn't worth spending month of coding here. THX a lot, Mike -- <NO> OOXML - Say NO To Microsoft Office broken standard http://www.noooxml.org
On 06-02-2008 12:57:32 +0100, Michael wrote:
I would be very pleased if there would be an LDAP language frontend to MonetDB. That is, MonetDB supporting the ldap and ldaps protocols. Of course the MonetDB that you would use there is a specially compiled/crafted version that has a very low footprint and excludes any functionality that is not necessary, basically just libgdk.
Hi Fabian,
what you write seems quite reasonable. My base idea was to provide another backend to the Apache Directory Server which could talk directly through MAL. Since you guys replied really quickly, I am aware now that it isn't worth spending month of coding here.
I wasn't aware of Apache DS. It looks like a very cool project. Of course, since it's written in Java, I now understand why you want to use Java. I can't seem to figure out how ADS does its storage at the moment, but I get the impression that it does the query evaluation itself internally, and that the JNDI bridge only does lookup/search and listings, instead of pushing the query logic down to the data storage backend. In MonetDB's case, I think you would only benefit of its performance if the engine would do the query evaluation, as it is optimised to do that very efficiently.
Fabian Groffen wrote:
On 06-02-2008 12:57:32 +0100, Michael wrote:
I would be very pleased if there would be an LDAP language frontend to MonetDB. That is, MonetDB supporting the ldap and ldaps protocols. Of course the MonetDB that you would use there is a specially compiled/crafted version that has a very low footprint and excludes any functionality that is not necessary, basically just libgdk. Hi Fabian,
what you write seems quite reasonable. My base idea was to provide another backend to the Apache Directory Server which could talk directly through MAL. Since you guys replied really quickly, I am aware now that it isn't worth spending month of coding here.
I wasn't aware of Apache DS. It looks like a very cool project. Of course, since it's written in Java, I now understand why you want to use Java. I can't seem to figure out how ADS does its storage at the moment, but I get the impression that it does the query evaluation itself internally, and that the JNDI bridge only does lookup/search and listings, instead of pushing the query logic down to the data storage backend. In MonetDB's case, I think you would only benefit of its performance if the engine would do the query evaluation, as it is optimised to do that very efficiently.
Fabian, I tould a deep dive into the Apache DS code. The only backend right now is a B tree. Any additional backend has to implement a certain interface which receives already-prepared queries in form of objects. Like you stated correctly, I have to map the objects to MAL, receive the result and push it back to Apache DS. Mike -- <NO> OOXML - Say NO To Microsoft Office broken standard http://www.noooxml.org
Niels Nes wrote:
On Tue, Feb 05, 2008 at 02:30:21PM +0100, Michael wrote:
Hi folks,
I just installed MonetDB. I tried to run the simplest examples and failed. :-( The MAL Reference does not semm really helpful though to me.
My questions is, is it possible to use the DB as an embedded server with a Java application? The exampled displayed a C example only. Is it possible to communicate to the server with MAL?
I want to write a backend for the Apache Directory Server. I want MonetDB to be it. I want to transform LDAP requests to MAL and get results back form the server.
Is this possible at all with this DB? FYI: I am a C illiterate
Interesting project. Using MAL at the java/jdbc layer is however only supported with a fixed set of rules. The most important one being, you have to take care of sending the right 'result sets' from the server, ie sent correct tabular results.
This means that it couldn't be possible from some point develop my solution. The otherway around would me that I would have to write a generic LDAP frontend for the DB just like the SQL or XQuery one? I see here 2 problems, I have only 3 month and I am C illiterate. Not feasable for me :-(
Embedding of monetdb is only possible with C code. So if wrapping using jni (or so) is possible then monet could run with java as well.
This isn't the problem. They could talk over TCP/IP through localhost too.
Could you point us to the examples which failed for you, probably we should improve the documentation.
For instance this one: # MonetDB server v5.2.2, based on kernel v1.20.0 # Serving database 'demo' # Compiled for i686-pc-win32/32bit with 32bit OIDs dynamically linked # Copyright (c) 1993-2007 CWI, all rights reserved # Visit http://monetdb.cwi.nl/ for further information #warning: please don't forget to set your vault key! #(see C:\Programme\CWI\MonetDB5\etc\monetdb5.conf) # Listening for connection requests on mapi:monetdb://127.0.0.1:50000/ # MonetDB/SQL module v2.20.2 loaded
function user.helloWorld(msg:str):str; io.print(msg); msg:= "done"; return msg; end user.hellowWorld; !SyntaxException:parseError:end user.hellowWorld; !SyntaxException:parseError: ^non matching end label, overruled
-- <NO> OOXML - Say NO To Microsoft Office broken standard http://www.noooxml.org
On Wed, Feb 06, 2008 at 11:54:39AM +0100, Michael wrote: [...]
Could you point us to the examples which failed for you, probably we should improve the documentation.
For instance this one:
# MonetDB server v5.2.2, based on kernel v1.20.0 # Serving database 'demo' # Compiled for i686-pc-win32/32bit with 32bit OIDs dynamically linked # Copyright (c) 1993-2007 CWI, all rights reserved # Visit http://monetdb.cwi.nl/ for further information #warning: please don't forget to set your vault key! #(see C:\Programme\CWI\MonetDB5\etc\monetdb5.conf) # Listening for connection requests on mapi:monetdb://127.0.0.1:50000/ # MonetDB/SQL module v2.20.2 loaded
function user.helloWorld(msg:str):str; io.print(msg); msg:= "done"; return msg; end user.hellowWorld; !SyntaxException:parseError:end user.hellowWorld; !SyntaxException:parseError: ^non matching end label, overruled
Michael, where did you find this one? Stefan -- | Dr. Stefan Manegold | mailto:Stefan.Manegold@cwi.nl | | CWI, P.O.Box 94079 | http://www.cwi.nl/~manegold/ | | 1090 GB Amsterdam | Tel.: +31 (20) 592-4212 | | The Netherlands | Fax : +31 (20) 592-4312 |
Stefan Manegold wrote:
On Wed, Feb 06, 2008 at 11:54:39AM +0100, Michael wrote: [...]
Could you point us to the examples which failed for you, probably we should improve the documentation. For instance this one:
# MonetDB server v5.2.2, based on kernel v1.20.0 # Serving database 'demo' # Compiled for i686-pc-win32/32bit with 32bit OIDs dynamically linked # Copyright (c) 1993-2007 CWI, all rights reserved # Visit http://monetdb.cwi.nl/ for further information #warning: please don't forget to set your vault key! #(see C:\Programme\CWI\MonetDB5\etc\monetdb5.conf) # Listening for connection requests on mapi:monetdb://127.0.0.1:50000/ # MonetDB/SQL module v2.20.2 loaded
function user.helloWorld(msg:str):str; io.print(msg); msg:= "done"; return msg; end user.hellowWorld; !SyntaxException:parseError:end user.hellowWorld; !SyntaxException:parseError: ^non matching end label, overruled
Michael,
where did you find this one?
Right here: http://monetdb.cwi.nl/projects/monetdb/MonetDB/Documentation/MAL-Functions.h... -- <NO> OOXML - Say NO To Microsoft Office broken standard http://www.noooxml.org
participants (5)
-
Fabian Groffen
-
Martin Kersten
-
Michael
-
Niels Nes
-
Stefan Manegold