• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

From Midlet to Database - the missing link

 
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi, I'm developing a j2me application. I want to send information inserted into a set of textfileds in a MIDlet to a table in a database. I have already developed the MIDlet graphically i.e. without the necessary connection code. I don't know what the next step is. I've done a lot of research about servlets, but most of it seems to involve web browsers and HTML - whihch I won't be using. I have tomcat runing succesfuly and mysql installed correctly. So I would appreciate if anyone could advise me what I require to update a table in the database from entries made into a MIDlet. Thanks!
 
Greenhorn
Posts: 28
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello.
So I would appreciate if anyone could advise me what I require to update a table in the database from entries made into a MIDlet.
You want to send data from the MIDlet to a server application, e.g. a servlet. You have to use HttpConnection to connect to the servlet. You use the POST method that is also commonly used when sending data in a form shown in a web browser. If you just need to send some strings, you can use the content-type "application/x-www-form-urlencoded". You have then to format the message in the body as following :
var1=value1[&var2=value2[&var3=value3[..]]]
The Sun Wireless Tool Kit 2 comes with the MIDP API documentation. Look at javax.microedition.io.HttpConnection for an example how an HTTP request is sent.
Christian Wolf
 
reply
    Bookmark Topic Watch Topic
  • New Topic