0

I'm working in a University project. My situation is very simple, I think: I take data from a table in local machine with this code on my Servlet:

BufferedReader br = new BufferedReader(new FileReader(new File("C:\\fileName.csv")));

Now, I want to take a step beyond: I want to read data from an external link in which there is a table (I created the link with Google Fusion Tables and it contains the identical data of my 'fileName.csv' in local machine).
How can I solve this? Thank so so much to who will answer!

Gia1090
  • 1
  • 4

1 Answers1

0

Google has an official API for its Fusion Tables that you can use.

Apart from that I think jsoup is the best tool to parse html documents (see this question if you cannot get page data directly with jsoup). If you know basic HTML and CSS then it's very easy to use this library.

Mahozad
  • 18,032
  • 13
  • 118
  • 133
  • I am new in Java, so the somehow is very difficult to apply for me :/ I take the content of the table and put it in an object, then I visualize it on jsp. Can you be more accurate, please. Thanks so much! – Gia1090 Jun 27 '18 at 14:26
  • By "table" you mean html element?
    – Mahozad Jun 27 '18 at 14:29
  • In Servlet I take the data as an object, in jsp I take the object and I put it in a
    – Gia1090 Jun 27 '18 at 14:34
  • Could you please share URL of your google fusion table? – Mahozad Jun 27 '18 at 14:42
  • Can I send you the code for email or something? Here is the URL https://fusiontables.googleusercontent.com/embedviz?viz=GVIZ&t=TABLE&q=select+col0,+col1,+col2+from+1MpxEn5AlnBGokIBt9GuBn1VrqzLKO6qYoIoJldN-&containerId=googft-gviz-canvas – Gia1090 Jun 27 '18 at 14:44
  • Google offers its api that you can make use of (unfortunately I don't have any experience in it and it seems that using that api requires some effort) – Mahozad Jun 27 '18 at 15:11