dcsimg
java.lang.NullPointerException while connecting to Oracle
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Aivars_Kalvans
Posted On:   Thursday, July 24, 2003 09:50 PM

I'm trying to run the following code from applet and get the exception below. I'm using ojdbc14.jar drivers and Oracle 9.2. The funny thing is that this code works from a simple program, but doesn't from applet (classpaths are ok), even with Oracle 8. Previously I used classes12.zip and it worked with Oracle 8, but not with 9. I have permission java.net.SocketPermission "xxx.xxx.xxx.xxx:1024-", "connect"; in java.policy. Java plugin version is 1.4.2. Any ideas of what I'm doing wrong? try{ DriverManager.registerDriver (new oracle.jdbc.OracleDriver()); DriverManager.getConnection ("jdbc:oracle:thin:@xxx.xxx.xxx.xxx:1521:xxx","xx","xx"); } catch (Except   More>>

I'm trying to run the following code from applet and get the exception below. I'm using ojdbc14.jar drivers and Oracle 9.2. The funny thing is that this code works from a simple program, but doesn't from applet (classpaths are ok), even with Oracle 8. Previously I used classes12.zip and it worked with Oracle 8, but not with 9. I have
permission java.net.SocketPermission "xxx.xxx.xxx.xxx:1024-", "connect";
in java.policy. Java plugin version is 1.4.2. Any ideas of what I'm doing wrong?

			try{
			
DriverManager.registerDriver (new oracle.jdbc.OracleDriver());
DriverManager.getConnection ("jdbc:oracle:thin:@xxx.xxx.xxx.xxx:1521:xxx","xx","xx");
} catch (Exception e) {
e.printStackTrace(System.out);
}

java.lang.NullPointerException
at oracle.jdbc.ttc7.O3log.marshal(O3log.java:612)
at oracle.jdbc.ttc7.TTC7Protocol.logon(TTC7Protocol.java:257)
at oracle.jdbc.driver.OracleConnection. (OracleConnection.java:400)
at oracle.jdbc.driver.OracleDriver.getConnectionInstance(OracleDriver.java:450)
at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:322)
at java.sql.DriverManager.getConnection(Unknown Source)
at java.sql.DriverManager.getConnection(Unknown Source)
at app.init(app.java:10)
at sun.applet.AppletPanel.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
   <<Less

Re: FYI [java.lang.NullPointerException while connecting to Oracle]

Posted By:   Aivars_Kalvans  
Posted On:   Friday, July 25, 2003 01:30 AM

Ok, I solved the problem by installing older drivers for Oracle 9.2.0.1 (instead of 9.2.0.3) and by adding following lines to java.policy:


permission java.util.PropertyPermission "oracle.jdbc.J2EE13Compliant", "read";

permission java.util.PropertyPermission "oracle.jserver.version", "read";
About | Sitemap | Contact