Thread: applet don't go
Hi, I wrote un applet that link postgres, it works fine only if I run it by appletviewer. By netscape it don't works. What I can do?
At 17:32 +0200 on 26/10/98, Andrea Antibo wrote: > I wrote un applet that link postgres, it works fine only if I run it by > appletviewer. By netscape it don't works. > > What I can do? Applets allow you to connect only to the server on which they live themselves. That is, if the Applet's source URL is on machine aaa.bbb.com, the datbase to which you connect must also be on aaa.bbb.com Appletviewer is more lenient about this, to allow you to test things from your own machine etc. Solutions: Run Postgres on the same machine as the applet. or Write a server which does the connection on behalf of your applet and returns it the results, and run it on the applet's machine. Herouth -- Herouth Maoz, Internet developer. Open University of Israel - Telem project http://telem.openu.ac.il/~herutma
On Mon, 26 Oct 1998, Andrea Antibo wrote: > Hi, > I wrote un applet that link postgres, it works fine only if I run it by > appletviewer. By netscape it don't works. Is the postgresql server the same as web server? Peter
On Mon, 26 Oct 1998, Herouth Maoz wrote: > At 17:32 +0200 on 26/10/98, Andrea Antibo wrote: > > I wrote un applet that link postgres, it works fine only if I run it by > > appletviewer. By netscape it don't works. > > > > What I can do? > > Applets allow you to connect only to the server on which they live > themselves. That is, if the Applet's source URL is on machine aaa.bbb.com, > the datbase to which you connect must also be on aaa.bbb.com > > Appletviewer is more lenient about this, to allow you to test things from > your own machine etc. > > Solutions: > > Run Postgres on the same machine as the applet. > > or > > Write a server which does the connection on behalf of your applet and > returns it the results, and run it on the applet's machine. Although I haven't tried it, the plug-gw module from fwtk (a free proxy based firewall toolkit) should do this ok (I don't think it handles OOB packets, but the current JDBC drivers don't use that option [yet] ). PS: I don't have the url for this handy, but if anyone needs it, I'll post it from work tomorrow. Peter -- Peter T Mount peter@retep.org.uk Main Homepage: http://www.retep.org.uk PostgreSQL JDBC Faq: http://www.retep.org.uk/postgres Java PDF Generator: http://www.retep.org.uk/pdf
On 26-Oct-98 Peter T Mount wrote: > Is the postgresql server the same as web server? > Yes, it does.
On 26-Oct-98 Herouth Maoz wrote: > Run Postgres on the same machine as the applet. It does this.
On Mon, 26 Oct 1998, Andrea Antibo wrote: > Hi, > I wrote un applet that link postgres, it works fine only if I run it by > appletviewer. By netscape it don't works. Ah, it's just hit me. Can you supply me the following: Version of netscape: Version of postgresql: Version of JDK: Peter -- Peter T Mount peter@retep.org.uk Main Homepage: http://www.retep.org.uk PostgreSQL JDBC Faq: http://www.retep.org.uk/postgres Java PDF Generator: http://www.retep.org.uk/pdf
At 8:21 +0200 on 27/10/98, Andrea Antibo wrote: > Yes, it does. Do you use the same domain name in the JDBC url and in the web site? It is not only required that the web server and the JDBC source will be the same machine - Java has to *know* it, so it's impossible to use "my.machine.com" in one, and "localhost" in the other. It is also impossible to use a local site "file://....", and "localhost" - it's not the same thing. So what are the URLs you are using? Herouth -- Herouth Maoz, Internet developer. Open University of Israel - Telem project http://telem.openu.ac.il/~herutma
On 27-Oct-98 Peter T Mount wrote: > On Mon, 26 Oct 1998, Andrea Antibo wrote: > >> Hi, >> I wrote un applet that link postgres, it works fine only if I run it by >> appletviewer. By netscape it don't works. > > Ah, it's just hit me. Can you supply me the following: > > Version of netscape: > Version of postgresql: > Version of JDK: netscape 3.02 and 4.05 (I think, because thy are at work) postgresql 6.3.2 jdk 1.1.5 Andrea Antibo______________________ http://www.geocities.com/Paris/3067 _______________________LINUX INSIDE
On 27-Oct-98 Herouth Maoz wrote: > At 8:21 +0200 on 27/10/98, Andrea Antibo wrote: > > >> Yes, it does. > > Do you use the same domain name in the JDBC url and in the web site? It is > not only required that the web server and the JDBC source will be the same > machine - Java has to *know* it, so it's impossible to use "my.machine.com" > in one, and "localhost" in the other. > > It is also impossible to use a local site "file://....", and "localhost" - > it's not the same thing. > > So what are the URLs you are using? uhm....on the html code I put <applet code=myapplet.class heigth=...></applet> myapplet.class is on the same dir of html file Andrea Antibo______________________ http://www.geocities.com/Paris/3067 _______________________LINUX INSIDE
At 9:47 +0200 on 28/10/98, Andrea Antibo wrote: > uhm....on the html code I put <applet code=myapplet.class >heigth=...></applet> > > myapplet.class is on the same dir of html file No, that doesn't help me... Tell me something like this: The URL of the HTML file is: http://my.domain.com/..... And the URL of the JDBC connection in the Java source is: jdbc:postgresql://my.domain.com/mydatabase/... Or at least give me the parts that comes instead of my.domain.com in your setup. Herouth -- Herouth Maoz, Internet developer. Open University of Israel - Telem project http://telem.openu.ac.il/~herutma
>> uhm....on the html code I put <applet code=myapplet.class >>heigth=...></applet> >> >> myapplet.class is on the same dir of html file > > No, that doesn't help me... Tell me something like this: > > The URL of the HTML file is: > > http://my.domain.com/..... > > And the URL of the JDBC connection in the Java source is: > > jdbc:postgresql://my.domain.com/mydatabase/... > > Or at least give me the parts that comes instead of my.domain.com in your > setup. > > Herouth the url of the html page is: http://my.domain.com/page.html for jdbc I have on the code of applet : jdbc:postgresql:mydb
At 18:30 +0200 on 28/10/98, Andrea Antibo wrote: > the url of the html page is: http://my.domain.com/page.html > > for jdbc I have on the code of applet : jdbc:postgresql:mydb Well then, you have to have THE SAME DOMAIN in both of them. The way the jdbc URL is written, it assumes it is running on the localhost. As soon as Netscape sees that it's not the same exact domain (it can't know that localhost is the same as my.domain.com), it refuses to cooperate. So change the URL like I showed you: jdbc:postgresql://my.domain.com/mydb In addition, make sure the url of the web page is indeed http: and not file:. Herouth -- Herouth Maoz, Internet developer. Open University of Israel - Telem project http://telem.openu.ac.il/~herutma
On Wed, 28 Oct 1998, Andrea Antibo wrote: > > On 27-Oct-98 Peter T Mount wrote: > > On Mon, 26 Oct 1998, Andrea Antibo wrote: > > > >> Hi, > >> I wrote un applet that link postgres, it works fine only if I run it by > >> appletviewer. By netscape it don't works. > > > > Ah, it's just hit me. Can you supply me the following: > > > > Version of netscape: > > Version of postgresql: > > Version of JDK: > > > netscape 3.02 and 4.05 (I think, because thy are at work) > postgresql 6.3.2 > jdk 1.1.5 Ah, 3.02 is definitely out (it's a 1.0.2 JVM). As for 4.05, I think that some parts of awt are still not implemented, but it should understand jdbc. I've got to upgrade my netscape, so I'll see if jdbc does work ok with it. Peter -- Peter T Mount peter@retep.org.uk Main Homepage: http://www.retep.org.uk PostgreSQL JDBC Faq: http://www.retep.org.uk/postgres Java PDF Generator: http://www.retep.org.uk/pdf
On 28-Oct-98 Herouth Maoz wrote: > So change the URL like I showed you: > > jdbc:postgresql://my.domain.com/mydb > > In addition, make sure the url of the web page is indeed http: and not file:. > > Herouth > ok, but it works the same by appletviewer or I must write 2 codes, 1 for appletviewer and 1 for netscape?
On 28-Oct-98 Herouth Maoz wrote: > So change the URL like I showed you: > > jdbc:postgresql://my.domain.com/mydb > > In addition, make sure the url of the web page is indeed http: and not file:. > > Herouth > ok, but it works the same by appletviewer or I must write 2 codes, 1 for appletviewer and 1 for netscape?