• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Accessing a database without using signing or policy file

 
Ranch Hand
Posts: 2379
MySQL Database Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
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.
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: 2379
MySQL Database Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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: java.security.AccessControlException : access denied (java.net.SocketPermission mysql.willnottellyou.com resolve)
reply
    Bookmark Topic Watch Topic
  • New Topic