aspose file tools*
The moose likes JDBC and the fly likes Access Control Exception Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "Access Control Exception" Watch "Access Control Exception" New topic
Author

Access Control Exception

Rejo Varghese
Greenhorn

Joined: Aug 07, 2009
Posts: 4
Hi,

I tried to change my jre from 1.4 to 1.6. But after changing that i am not able to connect to database. Whenever i try to connect to the database it throws an error when DriverManager.getConnection(connString,dbUser,dbPassword) is called.

java.security.AccessControlException: access denied (java.net.SocketPermission crestctdbd09.comfin.ge.com resolve)
java.security.AccessControlContext.checkPermission(AccessControlContext.java:269)
java.security.AccessController.checkPermission(AccessController.java:401)
java.lang.SecurityManager.checkPermission(SecurityManager.java:524)
java.lang.SecurityManager.checkConnect(SecurityManager.java:1023)
java.net.InetAddress.getAllByName0(InetAddress.java:1000)
java.net.InetAddress.getAllByName0(InetAddress.java:981)
java.net.InetAddress.getAllByName(InetAddress.java:975)
java.net.InetAddress.getByName(InetAddress.java:889)
java.net.InetSocketAddress.<init>(InetSocketAddress.java:114)
java.net.Socket.<init>(Socket.java:124)
oracle.net.nt.TcpNTAdapter.connect(Unknown Source)
oracle.net.nt.ConnOption.connect(Unknown Source)
oracle.net.nt.ConnStrategy.execute(Unknown Source)
oracle.net.resolver.AddrResolution.resolveAndExecute(Unknown Source)
oracle.net.ns.NSProtocol.establishConnection(Unknown Source)
oracle.net.ns.NSProtocol.connect(Unknown Source)
oracle.jdbc.ttc7.TTC7Protocol.connect(TTC7Protocol.java:1258)
oracle.jdbc.ttc7.TTC7Protocol.logon(TTC7Protocol.java:215)
oracle.jdbc.driver.OracleConnection.<init>(OracleConnection.java:307)
oracle.jdbc.driver.OracleDriver.getConnectionInstance(OracleDriver.java:442)
oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:321)
java.sql.DriverManager.getConnection(DriverManager.java:512)
java.sql.DriverManager.getConnection(DriverManager.java:171)
DBManager.DBmanager.getConnect(Unknown Source)

i have the classes12.jar added to my build path.

Thanks in advance for any help.


Rejo,
crazy developer.
Paul Sturrock
Bartender

Joined: Apr 14, 2004
Posts: 10336

classes12.jar (if I remember right) is Oracle 8 driver file for 1.2 jdks (that you could also use for 1.3 jdks). You should really swap to a much newer driver; this one was obsolete long ago.


JavaRanch FAQ HowToAskQuestionsOnJavaRanch
Rejo Varghese
Greenhorn

Joined: Aug 07, 2009
Posts: 4
Hey,
Its working now.. there was some problem with my workspace. when i got into another workspace and tried running the same it worked fine.... strange workspace :confused:

Thanks for your reply.. how abt using ojdbc14.jar? is that fine?
Paul Sturrock
Bartender

Joined: Apr 14, 2004
Posts: 10336

Sounds like a classpath issue.

how abt using ojdbc14.jar? is that fine?

Personally, I'd use the latest Oracle driver (which is ojdbc6.jar I think).
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Access Control Exception