Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 2 of 2

Thread: How do you do this in java?( This is urgent )

  1. #1
    Junior Member
    Join Date
    Apr 2013
    Posts
    23
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default How do you do this in java?( This is urgent )

    Deleted


  2. #2
    Junior Member
    Join Date
    May 2013
    Posts
    20
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: How do you do this in java?( This is urgent )

    Here's a start. It outputs the name for Taylor which you will have to modify for the retrieval on the URL. Thanks for the challenge...it was fun! My condolences to you as well.

    import java.io.*;
    import java.net.*;

    public class ReturnNames {

    /**
    * @param args
    */
    public static void main(String[] args) throws IOException {
    // TODO Auto-generated method stub

    URLConnection urlConn = null;
    InputStreamReader instream = null;
    BufferedReader in = null;
    String lines;

    try{
    URL url = new URL("http://adam.cc.sunysb.edu:80/acc/dirsearch.cgi?first=&last=taylor&status=Any");
    urlConn = url.openConnection();
    instream = new InputStreamReader(urlConn.getInputStream());
    in = new BufferedReader(instream);

    while (true){
    lines =in.readLine();
    if (lines != null){
    System.out.println(lines);
    }
    else{
    break;
    }
    }
    }catch (MalformedURLException e){
    System.out.println("Wrong URL "+ e.toString());
    }catch (IOException io){
    System.out.println("IO exception: " + io.toString());
    }


    }

    }

Similar Threads

  1. Need help with my java code! [URGENT]
    By proera92 in forum What's Wrong With My Code?
    Replies: 1
    Last Post: January 9th, 2013, 07:54 PM
  2. Need urgent help with Java Project
    By Bungie in forum What's Wrong With My Code?
    Replies: 1
    Last Post: November 26th, 2012, 05:10 PM
  3. [URGENT]Need some Java help...
    By RePT in forum Paid Java Projects
    Replies: 0
    Last Post: July 5th, 2012, 07:03 AM
  4. Need Urgent Help for Java assignment..
    By SamanthaBenny93 in forum What's Wrong With My Code?
    Replies: 11
    Last Post: May 22nd, 2012, 08:25 AM
  5. Need urgent help regarding java word wrap function.. URGENT
    By coldice in forum What's Wrong With My Code?
    Replies: 3
    Last Post: August 16th, 2011, 05:43 AM