private void process(){
String mobileNo = textField.getString().trim();
String lastName = null, firstName = null, otherNames = null, phoneNo1 = null;
// String url = "http://41.73.128.204:8080/ContactServer/ContactServlet";
String url = "http://localhost:8084/ContactServer/ContactServlet";
try
{
hc = ( HttpConnection )Connector.open( url );
hc.setRequestMethod( HttpConnection.POST );
int count = 0;
while ( count < 3 )
{
lastName = "Omoraro" + count + 2;
firstName = "John" + count;
otherNames = "Seun" + count;
phoneNo1 = "08106900300" + count;
String parameter = "phoneid=" + mobileNo + "&lastname=" + lastName + "&firstname=" + firstName
+ "&othernames=" + otherNames + "&phoneno1=" + phoneNo1;
hc.setRequestProperty( "Content-Type", "application/x-www-form-urlencoded ");
hc.setRequestProperty( "Content-Length", Integer.toString( parameter.length() ) );
dos = hc.openDataOutputStream();
dos.write( parameter.getBytes() );
lastName = null;
firstName = null;
otherNames = null;
phoneNo1 = null;
System.out.println(count);
count++;
}//end while
dis = hc.openDataInputStream();
int length = (int)hc.getLength();
byte[] data = new byte[length];
dis.readFully( data, 0, length );
response = new String( data );
System.out.println(response);
}//end try
catch(IOException e){
e.printStackTrace();
}
finally
{
try
{
if ( dis != null )
dis.close();
if ( dos != null )
dos.close();
if ( hc != null )
hc.close();
}//end try
catch( IOException e ){
e.printStackTrace();
}
}