RE: [INTERFACES] still the driver and IE5 problem - Mailing list pgsql-interfaces

From Nat Howard
Subject RE: [INTERFACES] still the driver and IE5 problem
Date
Msg-id 199909100000.UAA11264@spot.pupworks.com
Whole thread Raw
List pgsql-interfaces
Apologies if this comes to late for some.  

Using the 6.5.1 postgrsql release under FreeBSD and IE4, using jdk 1.1.8, 
I ran into the same problem that Georg Ritter ran into:

>From: Georg Ritter [mailto:Georg.Ritter@uibk.ac.at]
>Sent: Tuesday, June 15, 1999 2:32 PM
>To: pgsql-interfaces@hub.org
>Subject: [INTERFACES] still the driver and IE5 problem
>
>
>Hi, 
>
>I tried out the new driver ( thanks Pete! ) but - I am sorry 
>that I must tell - it still does not work.
>
>Interesting is: The M$-VM seems to find the driver 
>(status bar shows "loading Driver.class") but does not recog.
>it as suitable. (SQLEx: No suitable driver found)
>
>I will now try a combination of IE4 + SUNs Plugin and report.  
>
>I still would be pleased if anyone knows a solution. Time is
>passing by .. :-) and the system should go public at the end
>of the week.
>
>Greetings from Austria
>
>        Georg Ritter
>
>


A little web searching turned up an answer that works for
me (at least with IE4) at:

http://www.software.ibm.com/data/db2/java/v5/faq.html#q7

An excerpt:
Even if the driver is loaded properly, it may not be initialized.This can happen if the Java interpreter does not
automaticallyinitializeone the "DB2Driver"    classes upon loading. Some recent versions of the JDK for AIX    and OS/2
havethis problem. For these, the usual
 
    Class.forName("COM.ibm.db2.jdbc.app.DB2Driver");
    is not enough. One has to use: 
    Class.forName("COM.ibm.db2.jdbc.app.DB2Driver").newInstance();
    The dummy instantiation starts the needed class initialization. 

No flames, please -- I've no idea what the "correct" behavior for the
browser is.

So: Georg, you may be able to fix your problem by putting ".newInstance()"
in the right place this doesn't seem to harm appletviewer and 
Netscape (although you should check, of course).

Peter -- you may want to change your driver so that it does a newInstance(),
or change your README like this:

*** src/interfaces/jdbc/README  Sat Jan 16 23:51:49 1999
--- /tmp/README Thu Sep  9 17:53:06 1999
***************
*** 106,115 ****    introduce the driver using the following snippet of code:        try {
!         Class.forName("postgresql.Driver");       } catch(Exception e) {         // your error handling code goes
here      }     Remember, this method restricts your code to just the postgresql database. 
 
--- 106,119 ----    introduce the driver using the following snippet of code:        try {
!         Class.forName("postgresql.Driver").newInstance();       } catch(Exception e) {         // your error handling
codegoes here       }
 
+ 
+    The ".newInstance()" above is apparently required by InterNet Explorer
+    and perhaps others.
+      Remember, this method restricts your code to just the postgresql database.






pgsql-interfaces by date:

Previous
From: "Sergio A. Kessler"
Date:
Subject: Re: [INTERFACES] odbc DM 3.5x
Next
From: "Zubair Saifullah"
Date:
Subject: