Speed up the URL and Time out

I have a database of links I use a statment to read of them pass them to a URL and read the site to extract links from there, if it the URL is broken it takes me 10 minutes to go to the next one, I have 200 odd links any help as to speed this up...it took me a day to finish up the
[300 byte] By [aim_2ua] at [2007-9-29 5:14:30]
# 1
You could use multiple threads. This way you can still work on url's while one or the other thread is waiting for a responsregardsSpieler
spielera at 2007-7-14 18:26:52 > top of Java-index,Other Topics,Algorithms...
# 2

hey Spieler you said

> You could use multiple threads. This way you can still

> work on url's while one or the other thread is waiting

> for a respons

>

> regards

> Spieler

how do I go about that.

can you mail me an answer

I use

Statment stmt = con.createStatment("SELECT * FROM LinkTable");

ResultSet rs = stmt.executeQuery();

while(rs.next())

{

String str = rs.getString(2);

URLConnection conn =new URL(str).openConnection();

Reader rd = new InputStreamReader(conn.getInputStream());

EditorKit kit = new HTMLEditorKit();

Document doc = kit.createDefaultDocument();

doc.putProperty("IgnoreCharsetDirective", Boolean.TRUE);

// Parse the HTML.

kit.read(rd, doc, 0);

// Iterate through the elements of the HTML document.

ElementIterator it = new ElementIterator(doc);

javax.swing.text.Element elem;

while ((elem = it.next()) != null)

{

int cnt = 0;

st1 = new String();

SimpleAttributeSet s = (SimpleAttributeSet)elem.getAttributes().getAttribute(HTML.Tag.A);

if (s != null)

{

st1 = s.getAttribute(HTML.Attribute.HREF).toString();

System.out.println(st1);

}

aim_2ua at 2007-7-14 18:26:52 > top of Java-index,Other Topics,Algorithms...
# 3
Have a look at the tutorial http://java.sun.com/docs/books/tutorial/essential/threads/index.htmlregardsSpieler
spielera at 2007-7-14 18:26:52 > top of Java-index,Other Topics,Algorithms...