help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Octave and Database connectivity


From: Martin Helm
Subject: Re: Octave and Database connectivity
Date: Wed, 12 Sep 2012 10:44:22 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:15.0) Gecko/20120825 Thunderbird/15.0

Am 11.09.2012 20:01, schrieb ahowe42:
> Hello all
>
> I am scoping out a fairly substantial project which needs a) an
> array-oriented computation engine and b) a database. Free and/or
> FOSS is very much preferred, because I don't expect to have the money
> for expensive licenses. I am thinking of Octave and MySQL. Does
> anyone have example code for running SQL queries against MySQL from
> Octave? Thanks.
>
> Andrew
>
I tend to agree with Jordi, if this is a larger project from a software
engineering point of view (which is not really clear to me from your
description).
A poor man solution to run a mysql query from octave and get the results
back would be to use the system command in octave and run something like
that

system("mysql your_database --password=foo < my_requests.sql > out.csv");

and then read back the content of out.csv (it is tab delimited) and
process it.

If you need something more sophisticated you can (as already indicated
by Jordi) embed the octave interpreter in Python with Pytave and use
Python's capabilities to deal with databases or as an alternative use
the java package from octave-forge in octave which "embeds" java into
octave and communicate with your database via jdbc.
It all comes down to what you are already familiar with (java, python or
none of them) and what you really need.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]