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
Related
I made software in java Netbeans. I have use small database that is in ms access database.
Now I want to make it for client. So, please help me for make setup that is embed with database.
If it is possible to make jar with database included then tell me how it can be done.
If it is possible to make exe that is included with database so please help me to make setup. One more thing I want to connect database for client without configure with ODBC connectivity. So Please help me for that.
use embedded-databases instead of ms-access :
hsqldb
derby
...
I want to create a database for my android app.
At first, I want create it fully and then I will use it on my android project.
I can make sqlite database in SQLite IDE (sqlite database browser).
But I want to create it programmatically.
Because I will fetch data from a text file and push it to database.
It will be very fast and easier than IDE to make a database.
So my question, is there any way to make a SQLite database without SQLite database IDE in general java project (not specific to android) and what is that?
Thanks in advance.
Sorry for my bad English.
You basically would just need to include the appropriate connection jars in your project and implement your own C.R.U.D. operations. A quick google search comes up with a a bunch of good tutorials. Here's a basic one to start with.
You should look at this project https://bitbucket.org/xerial/sqlite-jdbc. I've used it in several projects. very good.
I am trying to create my own authentication system that connects from a Java program to MySQL database or to a PHP page that accesses the MySQL page. The Java program would check to see if the user is in the database and if it is, it would determine the list of features to display. I am currently trying to work on something simple, then work my way up.
I have searched on Google, but there are quite a few things out there; I wasn't sure which was the best way to go about doing this and what technologies to use from what I saw. I was wondering if anyone had any recommendations on how I should go about doing this or if they had an document, article, blog, etc that I could use to learn more about this.
Try Apache Shiro, its well documented and you can configure it with mysql(jdbc) database http://shiro.apache.org/
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.
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