-
retrieving info from a website
does anybody know how i would go about retrieving info from a website, using java, then placing it in a database. i can make a mock website for the project.
wud the using the URLReader class be going in the right direction
public class URLReader {
public static void main(String[] args) throws Exception {
URL yahoo = new URL("http://www.yahoo.com/");
BufferedReader in = new BufferedReader(
new InputStreamReader(
yahoo.openStream()));
String inputLine;
while ((inputLine = in.readLine()) != null)
System.out.println(inputLine);
in.close();
}
}
any help wu be much appreciated
-
Hi, the following link has a download on how to read data from a web site.
http://www.java.codeyourself.com/Download.php?ID=37
this next link, has a few downloads on how to get connected to a database. You need to know some SQL to be able to insert the data from the web site into your database
http://www.java.codeyourself.com/Cat...egory=Database
Hope it helps.
-
Well, when you use the url class you will have to handle the http protocol headers.
An easier approach is to use the httpclient by apache, which supports a lot of features, like https, proxies, and so on. there are also several examples of usage on the page.
Similar Threads
-
By Sandaruwan Wijenayake in forum ASP.NET
Replies: 0
Last Post: 07-25-2002, 08:41 AM
-
Replies: 3
Last Post: 03-07-2001, 10:22 PM
-
By John Nelson in forum VB Classic
Replies: 4
Last Post: 11-06-2000, 12:34 PM
-
By John Nelson in forum VB Classic
Replies: 0
Last Post: 11-06-2000, 12:09 AM
-
By Ashley in forum Enterprise
Replies: 2
Last Post: 05-02-2000, 11:00 AM
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
Forum Rules
|
Top DevX Stories
Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL
|
Bookmarks