inserting data to the google appengine's database - java

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.

Related

Sync SQLite DB on android studion with MySQL DB on web server

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.

Upload 50 millions of data to Google App Engine data store

I am trying to find the best way to transfer my huge data to google app engine datastore. We are java developers and it would be great if you can suggest the solutions around Google App Engine Java.
I have seen few solutions like google app engine pipeline, map reduce and tried them but nothing works. Is there any real solution that works?
Thanks,
Ramesh.V
What I did, split them into files of max 32MB? Upload them along with the backend source code and write a program on backend to fetch the data to datastore records... Mind you, each record has a maximum size of 1MB.
I do not know the best way, but have you looked at GAE/J's Remote API for Java?
Why don't you try Google BigQuery?
https://cloud.google.com/products/big-query
Here's a howto for the data transfer

How to create tables using GoogleAppEngine

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).

How to access online mysql database in android?

I have created an online database about the restaurants and I need to access this database through my android application, so that I can display the data to the users after filtering. My application does not need to update the database, but my problem is how to connect to my online mysql database and provide it to the users? I have looked on many suggestions on this site as well as on others, and I just found I have to use JSON parser while accessing but do not how to do it.
The best solution is provide a public API, managed for example with PHP, which delivers your database data filtered and displayed as your Android application needs.
This link might help you . http://www.androidhive.info/2012/01/android-login-and-registration-with-php-mysql-and-sqlite/
Just get an understanding of JSON parsers and how it can be used in android for retrieving data from database on server... you can write webservices in php..
You need to provide a server side solution that the Android application can speak to. PHP scripts are a good way to go, that can directly interface with the MySQL database, and return results to the device.
You can then be creative with the PHP script, by sorting the results etc, and providing a more comprehensive solution by taking away some of the processing from the Android device, and doing it server side where battery life isn't as much of a problem.
You simply need to implement web service calls on the Android device, simple GET/POST requests over HTTP suffice depending on what you intend to do. Have a look into REST APIs for guidelines on how to implement properly.
You can easily add a PHP script to the same server as the MySQL database for this

How do i read from database with J2ME?

I am busy with a project that requires me to read from a database and display certain results on mobile(J2ME). For example: I must list all customers in the database (SELECT * FROM CUSTOMERS) and i must display that results on mobile(J2ME). So some how i need to connect the mobile to the database.
How do i go about doing this? I really need help. I'm using Netbeans 6.5 and Postgres database.
Thanks in advance.
You cannot directly - JDBC is not supported on J2ME.
The common way is to expose your database via web services (SOAP, REST, etc.) and connect to those from the J2ME application. BTW, netbeans has a neat tool that generates proxy and j2me client library to j2me devices (arrives with the mobility pack)
You need to use JDBC + PostgreSQL Driver. There is a good tutorial here.
Here here and here are articles about JDBC for J2ME. To be frank, I've never use JDBC on J2ME. I just used them separately. So try it yourself.
I gotta go to work now so good luck. :D

Categories

Resources