Results 1 to 1 of 1
  1. #1
    Join Date
    Nov 2003
    Posts
    104

    Unanswered: SQLJ and Oracle 9i Connections issues in Java. Help would be appreciated!

    Hi All,
    I did a search and I could not find anything that helps out, so please don't flame me.

    Here is the situation.

    I am trying to run the folloiwing Java code. It compiles just fine, but when its run I get a whole bunch of weird exceptions.

    First off, the code...

    Code:
    try//look out for errors
            {
    
                //Oracle.connect(url,user,pwd);//attempts to open a connection to the database
                //Oracle.connect(url,user,pwd);
                  System.out.print("The Dastabase URL is: ");
                  System.out.println(url);
                  System.out.print("The User Is: ");
                  System.out.println(user);
                  System.out.print("The Password Is: ");
                  System.out.println(pwd);
                  cx1 = Oracle.getConnection(url,user,pwd,false);
                  DefaultContext.setDefaultContext(cx1);
                
                
            }
            
            //Catch exceptions and update the success boolean here
            catch(SQLException e)
            {
                success = false;
                
            }//end of try/catch
    Now for the fun part, this is the output I get!

    Code:
    The Dastabase URL is: jdbc:oracle:oci:@localhost
    
    The User Is: shassouneh
    
    The Password Is: win2k
    
    Exception occurred during event dispatching:
    
    java.lang.NoSuchFieldError:  oracle.jdbc.oci8.OCIEnv.envCharSetId
    
    	int oracle.jdbc.oci8.OCIEnv.get_env_handle()
    
    		native code
    
    	long oracle.jdbc.oci8.OCIEnv.getEnvHandle()
    
    		OCIEnv.java:70
    
    	oracle.jdbc.dbaccess.DBConversion oracle.jdbc.oci8.OCIDBAccess.logon(java.lang.String, java.lang.String, java.lang.String, java.util.Properties)
    
    		OCIDBAccess.java:390
    
    	void oracle.jdbc.driver.OracleConnection.<init>(oracle.jdbc.dbaccess.DBAccess, java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.util.Properties)
    
    		OracleConnection.java:361
    
    	java.sql.Connection oracle.jdbc.driver.OracleDriver.getConnectionInstance(java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.util.Properties)
    
    		OracleDriver.java:485
    
    	java.sql.Connection oracle.jdbc.driver.OracleDriver.connect(java.lang.String, java.util.Properties)
    
    		OracleDriver.java:337
    
    	java.sql.Connection java.sql.DriverManager.getConnection(java.lang.String, java.util.Properties, java.lang.ClassLoader)
    
    		DriverManager.java:517
    
    	java.sql.Connection java.sql.DriverManager.getConnection(java.lang.String, java.lang.String, java.lang.String)
    
    		DriverManager.java:177
    
    	void sqlj.runtime.ref.ConnectionContextImpl.<init>(sqlj.runtime.ref.ProfileGroup, java.lang.String, java.lang.String, java.lang.String, boolean)
    
    		ConnectionContextImpl.java:343
    
    	void sqlj.runtime.ref.DefaultContext.<init>(java.lang.String, java.lang.String, java.lang.String, boolean)
    
    		DefaultContext.java:172
    
    	sqlj.runtime.ref.DefaultContext oracle.sqlj.runtime.Oracle.getConnection(java.lang.String, java.lang.String, java.lang.String, boolean)
    
    		Oracle.java:580
    
    	boolean LoginPrompt.Connect()
    
    		LoginPrompt.java:419
    
    	void LoginPrompt.btnLoginMouseClicked(java.awt.event.MouseEvent)
    
    		LoginPrompt.java:297
    
    	void LoginPrompt.access$6000671(LoginPrompt, java.awt.event.MouseEvent)
    
    		LoginPrompt.java:28
    
    	void LoginPrompt$5.mouseClicked(java.awt.event.MouseEvent)
    
    		LoginPrompt.java:120
    
    	void java.awt.AWTEventMulticaster.mouseClicked(java.awt.event.MouseEvent)
    
    		AWTEventMulticaster.java:211
    
    	void java.awt.Component.processMouseEvent(java.awt.event.MouseEvent)
    
    		Component.java:3718
    
    	void java.awt.Component.processEvent(java.awt.AWTEvent)
    
    		Component.java:3544
    
    	void java.awt.Container.processEvent(java.awt.AWTEvent)
    
    		Container.java:1164
    
    	void java.awt.Component.dispatchEventImpl(java.awt.AWTEvent)
    
    		Component.java:2593
    
    	void java.awt.Container.dispatchEventImpl(java.awt.AWTEvent)
    
    		Container.java:1213
    
    	void java.awt.Component.dispatchEvent(java.awt.AWTEvent)
    
    		Component.java:2497
    
    	void java.awt.LightweightDispatcher.retargetMouseEvent(java.awt.Component, int, java.awt.event.MouseEvent)
    
    		Container.java:2451
    
    	boolean java.awt.LightweightDispatcher.processMouseEvent(java.awt.event.MouseEvent)
    
    		Container.java:2230
    
    	boolean java.awt.LightweightDispatcher.dispatchEvent(java.awt.AWTEvent)
    
    		Container.java:2125
    
    	void java.awt.Container.dispatchEventImpl(java.awt.AWTEvent)
    
    		Container.java:1200
    
    	void java.awt.Window.dispatchEventImpl(java.awt.AWTEvent)
    
    		Window.java:926
    
    	void java.awt.Component.dispatchEvent(java.awt.AWTEvent)
    
    		Component.java:2497
    
    	void java.awt.EventQueue.dispatchEvent(java.awt.AWTEvent)
    
    		EventQueue.java:339
    
    	boolean java.awt.EventDispatchThread.pumpOneEventForHierarchy(java.awt.Component)
    
    		EventDispatchThread.java:131
    
    	void java.awt.EventDispatchThread.pumpEventsForHierarchy(java.awt.Conditional, java.awt.Component)
    
    		EventDispatchThread.java:98
    
    	void java.awt.EventDispatchThread.pumpEvents(java.awt.Conditional)
    
    		EventDispatchThread.java:93
    
    	void java.awt.EventDispatchThread.run()
    
    		EventDispatchThread.java:85
    I am clueless why this is happening. I am running a local Oracle 9i Enterprise instance with the following details:

    SID: MainDB
    host: localhost (my machine)
    Java version: SDK 1.4.2 (from Sun MicroSystems)
    Java IDE used: Oracle JDeveloper 9.2 i


    Any help woudl be appreciated. This has been driving me nutts
    Last edited by shassouneh; 11-29-03 at 19:37.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •