This week's book giveaway is in the OCMJEA forum.
We're giving away four copies of OCM Java EE 6 Enterprise Architect Exam Guide and have Paul Allen & Joseph Bambara on-line!
See this thread for details.
The moose likes Sockets and Internet Protocols and the fly likes how to get the table data from internet and store in databse Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCM Java EE 6 Enterprise Architect Exam Guide this week in the OCMJEA forum!
JavaRanch » Java Forums » Java » Sockets and Internet Protocols
Bookmark "how to get the table data from internet and store in databse" Watch "how to get the table data from internet and store in databse" New topic
Author

how to get the table data from internet and store in databse

kishore nerella
Greenhorn

Joined: Jul 17, 2007
Posts: 15
hello
can any body tell me the procedure to fetch the <table> </table> data from internet and store it in database.

Its urgent...
Stan James
(instanceof Sidekick)
Ranch Hand

Joined: Jan 29, 2003
Posts: 8791
The Sun Socket Tutorial (see Google) has a nifty example of downloading a web page via URL and HttpURLConnection. Once you have that, you'd probably be best off with a real HTML parser. My favorite is no longer available for download, but Google will again help you out. The one in the library editor toolkit is probably good enough for jazz.

Let us know how you do with this!


A good question is never answered. It is not a bolt to be tightened into place but a seed to be planted and to bear more seed toward the hope of greening the landscape of the idea. John Ciardi
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41621
    
  55
I like to use jWebUnit for this. Although it's meant for testing web applications, it's quite easy to use for downloading web pages. It then presents the web page in a cleaned-up DOM-like way, which can be used to access various parts of the page.


Ping & DNS - my free Android networking tools app
kishore nerella
Greenhorn

Joined: Jul 17, 2007
Posts: 15
can you please send me the code of that program
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41621
    
  55
Assuming you're addressing me (and not Stan), that would be of little use. The code depends much on the structure of the HTML page. But the jWebUnit site has a number of introductory examples; those should get you going. Plus, you'll learn a lot more by doing it yourself instead of using someone else's solution. Feel free to come back here with questions, though.
 
Don't get me started about those stupid light bulbs.
 
subject: how to get the table data from internet and store in databse