Hmm,

my above sample works when I am not using H2 but a BufferedReader in a
loop!

I am a bit helpless here...
I tried System.setProperty ("http.agent", "Mozilla/4.0 (compatible;
MSIE 6.0; Windows NT 5.0)");
but that does not work!

What do you mean:

> (start with java -d*http.agent*="myAgent" ....)

commandline? as a param with conn url org:h2 ?
How would I do that on startup with my program?

> provide a cstom URL sceme

within H2? How?


Thanks again,

Dani


On 9 Feb., 15:58, Christoph Läubrich <[email protected]> wrote:
> You can try to set the default java 
> useragent:http://docs.oracle.com/javase/1.4.2/docs/guide/net/properties.html
> (start with java -d*http.agent*="myAgent" ....) alternativly cou can
> provide a cstom URL sceme.
>
> Am 09.02.2012 15:50, schrieb Dani:
>
>
>
>
>
>
>
> > Hey everybody,
>
> > I am fetching data from a website via FILE_READ('http://...') in my
> > SQL statement.
> > The site returns a "403" HTTP error because a check is made to
> > restrict access to "real" browser!
>
> > Is there a way to get a handle on the connection H2 establishes for
> > the FILE_READ operation in order to pass appropriate user-agent
> > information?
>
> > URL urlObject = new URL(urlString);
> > URLConnection conn = urlObject.openConnection();
> > conn.setRequestProperty ( "User-Agent", "Mozilla/4.0 (compatible; MSIE
> > 6.0; Windows NT 5.0)" );
> > st = conn.createStatement() ;
> > st.executeUpdate("INSERT INTO RAWDATA (HTML) VALUES ((SELECT
> > FILE_READ('http://...);
>
> > Thanks for any advice...
>
> > Dani

-- 
You received this message because you are subscribed to the Google Groups "H2 
Database" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/h2-database?hl=en.

Reply via email to