7 messages in com.mysql.lists.javaRe: mm.mysql.jdbc-1.2c and applets| From | Sent On | Attachments |
|---|---|---|
| Paulo Mora de Freitas | 17 Jan 2001 00:39 | |
| Carfield Yim | 17 Jan 2001 07:34 | |
| Guy Payne | 17 Jan 2001 07:39 | |
| Simon Fox | 17 Jan 2001 09:56 | |
| Dror Matalon | 17 Jan 2001 09:59 | |
| Gary Bentley | 17 Jan 2001 10:31 | |
| Artigas, Ricardo Y. | 17 Jan 2001 16:46 |
| Subject: | Re: mm.mysql.jdbc-1.2c and applets![]() |
|---|---|
| From: | Dror Matalon (dr...@matal.com) |
| Date: | 01/17/2001 09:59:46 AM |
| List: | com.mysql.lists.java |
I believe this is the right solution. The problem is that because of security reasons, the applet is only allowed to open sockets to the server that the applet was downloaded from. This is true for many folks, but I'm guessing that in your case the database server and the web server are different machines. You can try signing the applet and get the user to accept it, which is a major pain in the butt, or you can download the applet from the database server.
On Wed, 17 Jan 2001, Guy Payne wrote:
Signing the applet will allow the applet to make the connection. The user of the applet will have to accept and install the certificate use to sign the applet.
----- Original Message ----- From: "Carfield Yim" <carf...@desktop.carfield.com.hk> To: "Paulo Mora de Freitas" <mo...@poly.in2p3.fr> Cc: <ja...@lists.mysql.com>; <mys...@lists.mysql.com> Sent: Wednesday, January 17, 2001 8:35 AM Subject: Re: mm.mysql.jdbc-1.2c and applets
Applet don't allow bulid new socket connection, which will do when you make a connection from applet to database. The solution is writing a servlet to let applet call it.
On Wed, 17 Jan 2001, Paulo Mora de Freitas wrote:
Dear All,
Could someone help me to access my mysql database from an applet with mm.mysql.jdbc-1.2c?
The problem is that when trying to access a mysql database from an applet using Netscape it get an AppletSecurityException (described at end of this message). But the mm.mysql.jdbc-1.2c documentation says that "it allows Java developers to make connections to MySQL servers from both Java applications and applets", so I don't understand what is wrong. The same piece of code works nice if running as an application.
Cheers, Paulo Mora de Freitas.
Nestacape error message:
netscape.security.AppletSecurityException: security.Couldn't connect to 'aldebaran.in2p3.fr' with origin from 'local-classpath-classes'. at netscape.security.AppletSecurity.checkConnect(AppletSecurity.java:776) at java.lang.SecurityManager.checkConnect(SecurityManager.java:718) at java.net.InetAddress.getAllByName0(InetAddress.java:457) at java.net.InetAddress.getByName(InetAddress.java:367) at java.net.Socket.<init>(Socket.java:123) * at org.gjt.mm.mysql.MysqlIO.<init>(MysqlIO.java:114) at org.gjt.mm.mysql.Connection.<init>(Connection.java:229) at org.gjt.mm.mysql.Driver.connect(Driver.java:126) at java.sql.DriverManager.getConnection(DriverManager.java:90) at java.sql.DriverManager.getConnection(DriverManager.java:146) at SimpleApplet.paint(SimpleApplet.java:50) at java.awt.Component.dispatchEventImpl(Component.java:1734) at java.awt.Container.dispatchEventImpl(Container.java:946) at java.awt.Component.dispatchEvent(Component.java:1715) at
java.awt.EventDispatchThread$EventPump.dispatchEvents(EventDispatchThread.ja va:83)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:135) at
netscape.applet.DerivedAppletFrame$AppletEventDispatchThread.run(DerivedAppl etFrame.java:911)
SQLException: Cannot connect to MySQL server on aldebaran.in2p3.fr:3306. Is there a MySQL server running on the machine/port you are trying to connect to? (netscape.security.AppletSecurityException) SQLState: 08S01 VendorError: 0
--------------------------------------------------------------------- Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive)
To request this thread, e-mail <mysq...@lists.mysql.com> To unsubscribe, e-mail <mysql-unsubscribe-guyp=airc...@lists.mysql.com> Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
--------------------------------------------------------------------- Please check "http://www.mysql.com/Manual_chapter/manual_toc.html" before posting. To request this thread, e-mail java...@lists.mysql.com
To unsubscribe, send a message to the address shown in the List-Unsubscribe header of this message. If you cannot see it, e-mail java...@lists.mysql.com instead.
Dror Matalon




