This week's book giveaway is in the OCAJP 8 forum.
We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line!
See this thread for details.
The moose likes Java Micro Edition and the fly likes Connecting to Database Server Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCA Java SE 8 Programmer I Study Guide this week in the OCAJP 8 forum!
JavaRanch » Java Forums » Mobile » Java Micro Edition
Bookmark "Connecting to Database Server" Watch "Connecting to Database Server" New topic
Author

Connecting to Database Server

Jeffry Kristianto Yanuar
Ranch Hand

Joined: Oct 01, 2007
Posts: 759
Dear friends, I have a little problem about MIDP application.

How can I connect my MIDP application to the database server for doing CRUD (Create, Read, Update, Delete) ? Until now, I don't know what database server that will be used but I assume it will be MySQL. Are there any API for doing that ? Thanks for your help.


Jeffry Kristianto Yanuar (Java Instructor)
SCJA, SCJP, SCJD
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 17166
    
  27

JDBC isn't part of J2ME. So there's no universal way. Even if there was, 2-tier applications are a menace, as SQL Slammer demonstrated. You can't even do JDBC in 2-tier mode from unsigned Java applets, because it's such a security issue.

You might want to investigate setting up some sort of web service. Although it's not as convenient as the brute-force approach, it's more secure - besides insulating your backend database server direct outside attacks, you can use encrypted channels (https).

An IDE is no substitute for an Intelligent Developer.
Jeffry Kristianto Yanuar
Ranch Hand

Joined: Oct 01, 2007
Posts: 759
Can you provide the reference where can I use web-service for doing that ? Can I use servlet to connect to the database and using HTTP connection from my MIDP application to connect the servlet ?

Jeffry Kristianto Yanuar (Java Instructor)
SCJP 5.0 SCJA SCJD
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Connecting to Database Server
 
It's not a secret anymore!