Win a copy of Spark in Action this week in the Open Source Projects forum!
  • 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 ...
  • Campbell Ritchie
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
  • Piet Souris
  • Frits Walraven
  • Carey Brown

Accessing a database without using signing or policy file

Ranch Hand
Posts: 2376
MySQL Database Spring Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I know accessing a database from Applet has been discussed a lot times in this forum. But I m shortening the scope of my query in the following way explaining my scenario.
A group of company has its separate web sites for its individual businesses that uses MySQL as their backends, separately. Some applets will be developed that can query data from those database and delivered to those companies. They will use those applets in their web pages. A little deploy time modifications are acceptable. Some of those sites are written in PHP, some in ASP and some in JSP/Servlet.
1. I have to find out how is it possible for an applet to access remote databases using the data source names and corresponding name/password.
2. No policy file will be supplied to my client. It's not intranet.
3. Signed applet should be avoided in my findings, as this will only be used if no other option is available.
4. Http Tunnelling is the best way I know, but that is also out of scope in my scenario.
I first tried accessing local database from my Eclipse and its works fine through Eclpise runtime. But Eclipse writes a policy file that gives all permissions to the appletviewer and so it connects to the database without probolem. When I use it from browser or appletviewer from command promt, it can't connect to the database as I expected.
So I thought why don't I jar the database driver with the applet for my mysql database. And so prepared a jar containing my codes and pciked another mysql-connector-java-3.0.9-stable-bin.jar (MySQL driver). BTW, is this not a pure JDBC type 4 driver?
Now still my applet can't access the database. I am looing to my codes whether it has some problem with driver name, but no.
Any other viable solutions? Comments are appreciated.
Ashik Uzzaman
Ranch Hand
Posts: 2376
MySQL Database Spring Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Now I thought that okay, local file system will protect the applet with Security Exception naturally. Then what about using data source name as URL? So I used one of my products' mysql host to connect and retrive a simple select statement from applet.

And I get the message --

SQLException when setting up connection: : access denied ( resolve)
The world's cheapest jedi mind trick: "Aw c'mon, why not read this tiny ad?"
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
    Bookmark Topic Watch Topic
  • New Topic