Hi
I have a midlet that implements a Http connection to an asp script. the connection is successful and the midlet receives an OK response from the server.
My problem is how do I send a recordset back to the midlet?
tia
Hi
I have a midlet that implements a Http connection to an asp script. the connection is successful and the midlet receives an OK response from the server.
My problem is how do I send a recordset back to the midlet?
tia
What you can do is send the recodset as a delimited string back to the MIDlet and in the MIDlet you read the content and parse the string into Java objects or primitive types. For example:
[asp]
' oRS is the recordset of course
response.write(oRS("id") & ";" & oRS("name"
)
[/asp]
[MIDlet]
// after getting the response, where c is the connection object
InputStream is = c.openInputStream();
int ch;
StringBuffer sb = new StringBuffer();
while ((ch = is.read()) != -1) {
sb.append((char)ch);
}
String response = sb.toString()
// and now you go on to parse response (in this case, looking for
// the ';' and getting the substrings before and after it and putting
// them in the object where you store the recordset)
[/MIDlet]