In the cubesql documentation it says about json format communication but the example code is in php language. Can someone give an example code in xojo to connect to db and fetch some data.
Here's a basic example:
dim db as New CubeSQLServer db.Host = "yourdatabasehost" db.Port = 4430 //whatever port your cubesql listens on db.UserName = "yourusername" db.Password = "yourpassword" if (db.Connect = false) then MsgBox "Connection failed: " + db.ErrorMessage + " (" + Str(db.ErrorCode) + ")" return end if //Once you are connected, you can query like this: dim rs as RecordSet = db.sqlSelect("your sql query here") //deal with results, etc.
In order to try to supports as much heterogeneous clients as possible cubeSQL fully
supports the JSON open standard protocol. JSON is a lightwave text based protocol and
is built-into any major language (like PHP, Ruby, LiveCode and so on). In this version only
JSON over TCP/IP is supported, next version will also support JSON over HTTP.
For a complete and working JSON implementation we strongly suggest you to take a
look at the cubeSQLServer.php class.
In the cubesql documentation it says about json communication over tcp / http. I tried the tcp method and was not able to connect because of invalid credential error. I believe its because of sha1 cripto issue in xojo. For the http method cubesql is not even accepting the communication. I have send a mail to cubesql and haven't got a reply yet. Anyone can try this as cubesql is free for 2 users.
In this version only JSON over TCP/IP is supported, next version will also support JSON over HTTP.
I don't know if the next version is out yet.
I can't find anything about 2011, this is what the PDF show on the first page:
© 2005-2019 SQLabs, All rights reserved.
I don't know much about CubeSQL but I think the logo was updated recently and the new one is shown on that PDF.
Anyway, if JSON works now with HTTP, then you can use it (I guess). Good luck.