Dear all,

 

You might have to add the following call before sql :connect() :

 

sql:init("com.mysql.jdbc.Driver")

 

I found it mandatory in xqm modules run inside Tomcat, for example.

 

If you start playing with the SQL module,

You will realize that BaseX rocks also on SQL repositories !

With RESTXQ+SQLMODULE you can write in a few lines a REST service exposing SQL data.

 

Best regards,

Fabrice Etanchaud

Questel/Orbit

 

 

De : basex-talk-bounces@mailman.uni-konstanz.de [mailto:basex-talk-bounces@mailman.uni-konstanz.de] De la part de Lizzi, Vincent
Envoyé : mercredi 19 novembre 2014 23:31
À : Hans-Juergen Rennau; basex-talk@mailman.uni-konstanz.de
Objet : Re: [basex-talk] BaseX and MySQL

 

Hans,

 

I had to do this a few days ago, so it’s fresh in my mind. Download Connector/J from the MySQL website and place .jar file in the basex/lib folder. Restart BaseX (if you’re using the server version) so it picks up the new .jar.

 

Queries can then be run like:

 

let $c := sql:connect('jdbc:mysql://localhost/database', 'user', 'password')

sql:execute($c, "select …")

sql:execute($c, "call stored_procedure…();")

 

 

Cheers,

Vincent

 

 

From: basex-talk-bounces@mailman.uni-konstanz.de [mailto:basex-talk-bounces@mailman.uni-konstanz.de] On Behalf Of Hans-Juergen Rennau
Sent: Wednesday, November 19, 2014 5:20 PM
To: basex-talk@mailman.uni-konstanz.de
Subject: [basex-talk] BaseX and MySQL

 

Dear BaseX team,

 

can you point me to some information about which steps I must take in order to start accessing MySQL databases via the sql module? 

 

Thank you for help,

Hans-Juergen