• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Carey Brown

Problems with Netscape and IE

 
Ranch Hand
Posts: 65
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am an ultra newbie to Java and JDBC. I have recently created a small Java applet that returns some query results from a MySQL DB. The DB is local. The problem is this: when I view an html page containing the applet with the Sun appletviewer, the applet runs problem free, ie perfectly. When I try to view the applet in IE or Netscape, I receive the following error: SQLException:java.sql.SQLException: Cannot connect to MySQL server ...
Can anyone explain what the problem is? or perhaps simply clarify whether the problem lies with my JDBC setup or my MySQL setup?
Thanks in advance,
-MLA
 
Sheriff
Posts: 6920
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Applets in a browser run in what is known as a "sandbox" which prevents them from accessing (and corrupting!) files and other resources on the client machine. Applets are only able to open network connections to the machine they were downloaded from, so you should make sure that your MySQL database is running on the same machine as the web server, and that you access it using the same machine name or IP address as you used in your < APPLET > tag.
 
Michael Arnett
Ranch Hand
Posts: 65
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Problem partially resolved. In my applet code I had the literal ip address ( For example "jdbc:mysql://111.111.111.111:3306/test"), but I replaced this with the hostname ("jdbc:mysql://localhost:3306/test") and this seemed to resolve my problems with Netscape but not IE. Any ideas appreciated
Thanks in advance,
-MLA
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
    Bookmark Topic Watch Topic
  • New Topic