File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Problem connecting to Database

 
Ankit Nagpal
Ranch Hand
Posts: 47
Eclipse IDE Java
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,

While working on a JDBC code today, I got the following exception while creating a connection with Oracle:

java.security.AccessControlException: access denied (java.net.SocketPermission 127.0.0.1:1521 connect,resolve)

After looking through many forums and lots of googling, I found out the solution and added the following line in the .java.policy file:

grant {
permission java.net.SocketPermission "127.0.0.1:1521", "connect, resolve";
};

The code is working fine now, but just wanted to know why this problem started occurring after so many years of coding in JDBC since this wasn't the first time I was creating a connection and testing it.

I did not install/uninstall anything at my end.

Any answers??
 
Jelle Klap
Bartender
Posts: 1951
7
Eclipse IDE Java
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I guess you're either calling the JDBC driver from inside an applet or an application that uses a security manager.
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic