|
|
|||||||||
|
|||||||||
|
|||||||||
| |
|||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
Displaying info from a servlet on a midlet
Hi
I am writing an application for a mobile. My midlet connects to a java servlet which has a database connection. So far information received from the database, is displayed as follows On the servlet: res.setContentType("text/plain"); PrintWriter out = res.getWriter(); ……….. ……….. rs = stmt.executeQuery("SELECT * FROM food"); while(rs.next()) { out.print(rs.getObject(1).toString()); out.print(rs.getObject(2).toString()); out.print(rs.getObject(3).toString()); } And in the midlet, the information is got by textFromServer = new String(servletData); append(textFromServer); The above snippets of code works and displays all the data from the database. Problem is it just displays one long string. How do I separate the “servletData” out so that I can add a choice group to each row? Do I need to use xml to help me in design? I don’t know how to use xml or where to start with it. Any pointers? Thank you |
![]() |
| Viewing: Dev Articles Community Forums > Programming > Java Development > Displaying info from a servlet on a midlet |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|