File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes JDBC and Relational Databases and the fly likes Problem connecting to Database Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » JDBC and Relational Databases
Bookmark "Problem connecting to Database" Watch "Problem connecting to Database" New topic

Problem connecting to Database

Ankit Nagpal
Ranch Hand

Joined: Sep 09, 2008
Posts: 47

Hi All,

While working on a JDBC code today, I got the following exception while creating a connection with Oracle: access denied ( 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 "", "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

Joined: Mar 10, 2008
Posts: 1951

I guess you're either calling the JDBC driver from inside an applet or an application that uses a security manager.

Build a man a fire, and he'll be warm for a day. Set a man on fire, and he'll be warm for the rest of his life.
I agree. Here's the link:
subject: Problem connecting to Database
It's not a secret anymore!