I have a local sqlite database, and a lightweight mini-httpd server on the same linux host.
I'd like to provide web visualization of the data contained on the sqlite database.
I've checked Google Charts and it basically does what I need, but doesn't directly connect to sqlite. Should I feed the data manually with javascript?
What is the best way for showing result of sqlite queries to a web browser?
If you want to show statistic with Google Charts you have to provide the data with a proper format.
You need an app where to make request and connect to the DB running on the webserver, make the query with javascript to that app and then pass the data to G charts.
You have also tons of libraries to show data, all you have to know is the licence your site will be running. jchartfx if really powerfull
Related
I need to run my R-code through a website, with the user giving feature values from the website itself, which I have to use as new data for prediction in the R-code. How can I do it?
Have a form on the website which performs an HTML post to a REST api on your web server which will write the information to a database such as MySql, Postgres, MongoDB, or any other database of your choice. Then use a DBMS database management system (DBMS) such as MySQL Workbench, pgAdmin, or Robomongo to query the database and put the data into a csv file, and run your R-code on it. Then use the parameters from your machine-learning model on your server to serve content.
You can expose any R code as a REST API using packages such as plumber, OpenCPU or RestServ. Such an API can then be integrated into the website using Jacascript.
Okay so its like this. I am using Microsoft Visual Studios (Javascript/HTML/CSS coding) to create an app which retrieves and sends data into a MySQL database. I setup my MySQL database using MySQL workbench. I created a localhost and connected Visual Studios to the database. It shows the connection on the Server Explorer on the left side of the IDE.
And this is where I get stumped. I don't know how exactly to retrieve the data set inside that database. I've been taught to use Eclipse and phpMyAdmin using a php file to connect, retrieve and store data into the database.
However, I am not familiar with how Visual Studios do their data retrieval. How do I go about this guys?? Basically, I got an HTML file, a CSS file, a Javascript file, I got the MySQL database running and it says I have connection to it on Visual Studios.
The database name is EmployeeCred, and inside the database is a table called employeelogindata with columns of informations.
What should I do?
You'll need to create some sort of API for your JavaScript(frontend) to interact with. You could create a PHP API(backend) which would connect to the database and return JSON data for your frontend. You could then access this using the JavaScript fetch API
Actually, for those still wondering how, Visual Studios has a service for Cordova App which allows for a built-in backend service to the app. Simply go to the Overview panel and look up the backend service feature. Follow the steps and read through the Corodva Documentation available on the internet.
I'm pretty new to OSM (OpenStreetMap). I'm developing a cross platform mobile application with IONIC/CORDOVA.
I want to save OSM data in my database. Is to possible to save osm data in SQLite? Or anything better than SQLite for this project such as JSON? If it is possible then how can I manipulate/query data from there?
Thank you in advance.
You can export OSM data to lots of formats, and you can save that data in a database. However, you cannot use PostGIS in SQLite so you have to come up with your own query system.
If you already have a (semi) working system using PostGIS I'd suggest implementing a (web) API to serve the data to your app from a database running on a server instead of trying to bundle all needed data and do the querying on a mobile phone.
Alternatively if the app uses data that can be precomputed you could run the queries using PostGIS and bundle the result with your app. (In GeoJSON, CSV, KML, ... format)
This is of course dependent on the type of data and queries that you need - if you extend your question to include that I might be able to give a more specific answer.
I want to do an app with ionic framework and cordova for Android and iOs and I want to optimize at most the requests to the server.
I need to get data from php server (API) and store in the mobile phone, this data is related, so I think that a SQLite is the best option to store it in the device because of to show it is more fast to do a complex SQL than get a JSON stored in localstorage (for example) and search and link the data in the mobile. I'm right?
I need to do this and can do a Pull to refresh in the app and get only new data.
I've been watching some solutions but I don't know what is the best.
Parse/Firebase: This is difficult to administrate for non-specialists, for this I have a backend to enter and modify data with the relations easily. In addition this services return a JSON with more data that I need.
Persistence.js and Persistence.sync.js this works with mysql-server and sqlite-local but can I sync only one table or get only the new data? And I did't find a solution for php server.
CouchDB and PouchDB: I don't know if this can be sync only for a new records.
Receive data in JSON and store it in SQLite: I need to create functions to do this easier.
Any other solutions?
I'm very lost in this topic.
Thanks!!
CouchDB and PouchDB: I don't know if this can be sync only for a new records.
That’s the default. Plus they handle all the nasty sync details for you. Would highly recommend looking into this.
I have recently seen articles on HTML5 and local Db creation and usage. I have also seen some examples of Javascript connection strings to existing Access Db backends. I am interested in finding a way to build a Db, pre-load it with records, and use a web app to connect and read the Db. For example, I have created many standalone applications with Tcl, in Windows, that read off of Sqlite Db files. Essentially, the application (.exe file) and Db file sit next to each other in a folder and function like any other Db application, except without the use of servers.
I would like to be able to do the same, but with a web app (.html) and Db file. Does anyone know if this is possible? As an example, I wanted to build a language application that runs in any browser, with pre-loaded words saved in the backend. So there would be two files, the web app, and the db file.
Any suggestions or links to resources would be really appreciated. The only thing close that I could come up with was connecting to Access via OLE through Javascript, however I need a Db that is multi-platform like Sqlite.
Thanks,
DFM
Your web app, its local database, and the "priming" data will all have to start somewhere, so I'll assume this all gets rolling during a live connection to a web server. When this first hit comes in, you:
Deliver the page and related code.
In your JavaScript, test for the existence of the database.
Exists? No priming necessary. Do nothing, or sync, etc.
Doesn't exist? Build it and deliver initial data. If this is slow, you can give the user a friendly warning: "Setting up, please stand by." Depending on how you're pushing down all that data, you might even show a progress bar: "Initializing database: 10%"...
There is no step 3.
Once setup is complete, this app could be entirely local -- no net connection required -- as long as you code it without the assumption of non-local resources.
References:
Getting Started with HTML5 Local Databases
Offline Web Applications in HTML5
You can access an already created sqlite db file through javascript. Look at the "Location of Database File" area of this link http://code.google.com/apis/gears/api_database.html
I know this is for Google Gears, but Gears uses SQLite and the location still applies without Gears and only using a sqlite db file.
For example, I used a firefox add-on 'SQLite Manager' to create a sqlite db file on my local machine. I then copied that file to C:\Users\\AppData\Local\Google\Chrome\User Data\Default\databases\file__0
I was able to access the file using JavaScript in Google Chrome:
var db = null;
try {
if (window.openDatabase) {
db = openDatabase("mydbfile.sqlite", "1.0", "HTML5 Database API example", 200000);
....
You have to be careful with the file name in Chrome as it automatically names each sqlite db by an id number. For example, I had to rename my sqlite db file name to 14 to get it to read from JavaScript in the browser. Once I did this, it worked like a champ and I was able to access all tables, data, etc.