×

Discussion Board

Results 1 to 2 of 2
  1. #1
    Registered User
    Join Date
    Mar 2003
    Posts
    2

    invoking an asp script

    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

  2. #2
    Super Contributor
    Join Date
    Mar 2003
    Location
    Israel
    Posts
    2,280

    RE: invoking an asp script

    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&quot) & ";" & oRS("name&quot)
    [/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]

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
×