Skip to content
Branch: master
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
48 lines (34 sloc) 897 Bytes
Mathematica5 -> Q interface
(Felix LUNGU, First Derivatives PLC)
1. download (,compile and jar the
in $QHOME (c:\q or $HOME/q) as c.jar:
cd $HOME/q
mkdir tmp
javac -d tmp
jar cvf c.jar -C tmp .
rm -fr tmp
cd c:\q
mkdir tmp
javac -d tmp
jar cvf c.jar -C tmp .
rmdir -fr tmp
2. Start Mathematica Kernel console
3. Load the JLink module:
4. Start Java:
InstallJava[CommandLine -> "javaw", ClassPath -> "c:\\q\\c.jar"]
5. Create c object:
c = JavaNew["c", "localhost", 5001]
6. Call the "k" method to execute queries:
r = c@k["select from trade"]
7. Inspect the a flip from query:
Note: some classes (Date,...) don't have a direct mappings
in Mathematica.
You may want to write a wrapper to addapt them to Mathematica or
call the "toString" method on them.
You can’t perform that action at this time.