# Cloud Form Function Database

I am trying to build a web inventory application using a SQLite database hosted in the cloud home directory. I have a database in the home directory and I can query that database while in the code editor but when I publish to a webform the code does not work.

Needs["DatabaseLink"];
dbFilePath="/wolframcloud/userfiles/********";
conn=OpenSQLConnection[JDBC["SQLite",dbFilePath]]

SQLSelect[conn, "key"]


works file when I am in the notebook. I then go to deploy it to the cloud..

CloudDeploy[FormFunction["Table" -> {"key"-> "key","eltesting"-> "eltesting"},SQLSelect[conn,#Table]&]]


Then when I press submit I get response:

DatabaseLinkSQLSelect[DatabaseLinkSQLConnection[DatabaseLinkJDBC["SQLite", "******"], JLinkObjectsvm1JavaObject10700769468612609, 6, "Catalog" -> Automatic, "Description" -> None, "Location" -> None, "Name" -> None, "Password" -> None, "Properties" -> {}, "ReadOnly" -> Automatic, "RelativePath" -> False, "TransactionIsolationLevel" -> Automatic, "UseConnectionPool" -> Automatic, "Username" -> None, "Version" -> None], "key"]


I have replaced my file path with ****** for security. If local database storage is not supported what is the best way for my application to store, update and retrieve data? DataDrop is not the correct solution as I need this data to last more than 30 days.

• Welcome to Mathematica.SE! 1) As you receive help, try to give it too, by answering questions in your area of expertise. 2) Take the tour and check the faqs! 3) When you see good questions and answers, vote them up by clicking the gray triangles, because the credibility of the system is based on the reputation gained by users sharing their knowledge. Also, please remember to accept the answer, if any, that solves your problem, by clicking the checkmark sign! – user9660 Mar 23 '16 at 13:28
• Do you have a free Wolfram Development Platform account? Perhaps SQL commands like SQLSelect are disabled for such an account. The pricing page mentions database connectivity at the 100/month Producer price point. Wolfram support might be able to tell you if SQLSelect starts working at the 20/month Explorer price point. If you included the SQLite setup code in your question, it would be easier for others to test this. – Christopher Haydock Mar 23 '16 at 14:49
• @ChristopherHaydock here is some code to create a database so you can test. It will be empty but then calls should just return {}. Needs["DatabaseLink"]; conn = OpenSQLConnection[ JDBC["SQLite", ToFileName[Directory[], "example"]]] – Ray Troy Mar 23 '16 at 15:24
• At the Explorer price point of the Wolfram Development Platform CloudDeploy[Delayed[Needs["DatabaseLink\[RawBackquote]"]; SQLTables[OpenSQLConnection[JDBC["SQLite", FileNameJoin[{$CloudRootDirectory, "EmptySQLiteDatabase"}]]]]], FileNameJoin[{$CloudRootDirectory, "EmptySQLiteQuery"}]] does not give the expected empty list, but just displays unexecuted code like that you've posted above. I've emailed Wolfram Support asking if this code will execute at the Produce price point. – Christopher Haydock Mar 23 '16 at 20:05

CloudEvaluate[
Needs["DatabaseLink"];
`