I want to store a list of friends and their locations (GPS coordinates) on the googleAppengine. I am using J2ME with Netbeans. How do I store or create table in Google App Engine?
The App Engine datastore is schemaless. The closest thing to a table in a relational database is the kind. Each kind holds entities (records) all of which have attributes (fields). It is important to note that the entities of a given kind do not need to have the same attributes. See the datastore documentation for more information.
When writing to the App Engine datastore you do not create a table / kind in advance, instead you simply create the entity (record) of a given kind you'd like to store, and tell App Engine to store it. See here for a short example.
If you would like to use a relational database with App Engine, use Google Cloud SQL (essentially a MySQL database co-located with your App Engine application).
Related
I have created an app to enable users to manually log data for their use of phytosanitary products in their fields.
I would like to store all of this data one the app engine.
I thought of storing it as entities on the google app datastore but then is there a way to gather all that data afterwards and make it downloadable as an XML file for example?
The only data that will be stored each time will be the following:
I am using Vaadin to handle the whole application
AFAIK, you will need to write code to read data you want from Datastore and convert it to the form you need - XML or something else. Then you can trigger above functionality at a specific URL (click of a button) or as a scheduled job that emails you the XML or stores it in a Cloud storage bucket.
I am developing an android app that measures the radio interface parameters of a network periodically, stores the data in SQLite DB and transfers the data stored to MySQL DB on a web server. How can I make this possible?
I've done some research on this and found only one usable option, which is to make a web service using json or xml to pull/push data between the two databases. You could create a database link between the two, but this is not advisable.
There are numerous questions with a more detailed scope for this issue and you should be able to find one that fits your use case. If not, ask a new question after this research with more details and what you've done so far.
For my website I wanted to store the IP address of every visitor.I had been doing this with derby+Tomcat,but I don't know how to do this with google appengine. How can I insert data to appengine's database ? I mean how do I connect to its database.
I have no idea how to do this.
NOTE : It will be great if somebody answers me with some code,that tells me how to connect to the database to start sending queries.
The link below is really a good introduction guide. You don't have to understand at all how Google App Engine datastore works to be able to store / retrieve data + there is a very active community to support you.
http://code.google.com/p/objectify-appengine/wiki/IntroductionToObjectify
First of all, you need to select your interface for connecting to the GAE datastore. Your choices include:
the GAE low-level datastore API
JPA
JDO
Objectify
Twig
(apologies to any I have missed). Then you need to study the relevant documentation to find out how to use your selected interface.
Google app engine's datastore is a bit strange when comparing with other sql-databases. It needs quite a lot of learning.
But if you are not really interested in it, then you can try google's fusion tables. Its free and also it has SQL-like query mechanism.
It needs a slighter modification to your existing application. Signup for fusion tables then store and access your data through Fusion table API in App Engine.
Is it possible to use SQLite as a relational database from Google App Engine? (Java) I need read/write access to it from the app itself.
Also, I am using Quercus for PHP, and if what I am asking for is possible, I can handle storing the database myself.
No, it is not possible. This would require write access to the filesystem, which App Engine does not allow.
SQL database support (MySQL like) is planned, but no release data has been given. For now, use the datastore.
I know it's a super old question and nothing concerning read-only properties of App Engine has changed since then... But actually you can use sqlite on Google App Engine. There is a writable /tmp directory (https://cloud.google.com/appengine/docs/standard/java-gen2/using-temp-files). If your app on startup first copies the db.sqlite3 file to /tmp/db.sqlite3 and references this path as database path, it will work.
The following problems are connected with this approach:
This directory is "in-memory". So if you want to use really large sqlite file, you may face problems with RAM.
Each node of the app gets its own copy of the database. If you save something on one node, these changes will not be seen by other nodes. And the new data will be lost if the app scales to 0.
I'm working on creating a checkbook app for android using a database to record transactions. The design I'd envisioned was/is to allow the user the ability to create different "accounts" (savings account, checking account, etc) under whatever name they choose and use that as the database table name. However, using preparedStatements doesn't work when I try to create a table. So I'm wondering if I'm going to need to sanitize the input manually or if I'm missing something. This is my first Java/android database program and I've got no formal education in databases so its possible I completely missed something. **edited to reflect more accurately what I meant by account. As this will be on an android device I have no interest in multiuser setup.
Probably, you don't need a table for each user. You should revise your database structure.