trouble creating SQL database in java with loadbang.net.sql

Dec 4, 2011 at 5:39pm

trouble creating SQL database in java with loadbang.net.sql

I’m trying to use a local SQL database in Max. My best option is to use HSQLDB implemented in Max with the tools found at loadbang.net.

I’ve downloaded the 4 required .jar files from loadbang.net, put them in the Max “lib” folder. The patch that you can download as an example works fine.

I know nothing about Java, but would like to modify/use the code from loadbang.net so that I can do database operations from within my own [mxj] and Java code. I downloaded the Eclipse Indigo IDE, but get an error when trying to open any of the .jar files, with no apparent error information. I know little-to-nothing about developing Java other than my experience with [mxj quickie]. Is there a way? Thanks.

EDIT: I’m figuring out now that I don’t even need to decompile or look at the code, but instead use the net.loadbang.sql.mxj.NoddySQL class (and associated online documentation) within my own Java code. Sorry, brand new to this stuff, but I’ll figure it out.

EDIT2: wrong again. I guess the NoddySQL class is the wrapper for creating an mxj to run queries from Max. So if I’m running queries and accessing results only from within my pre-existing [mxj], maybe I shouldn’t be using the loadbang.net stuff, but figuring out how to use HSQLDB classes directly within my code. Note to Nick Rothwell: such a great and simple idea with the placeholder file, even though I’ll have to figure out the HSQLDB file specification stuff anyway…

#60459
Dec 5, 2011 at 7:59pm

NoddySQL is a (poorly-named) MaxObject class for taking plain SQL statements and running them against HSQL – there’s not much in there of interest if you want to talk to the database directly.

If you want to generate and run SQL internally, you’re probably better off calling into it from Jython:

http://www.loadbang.net/space/Software/net.loadbang.jython

That saves you the effort of getting any Java machinery off the ground, and is likely to look a lot neater.

(If you’re really in the mood to party, you could even do it in Clojure.)

#217602

You must be logged in to reply to this topic.