RE: [INTERFACES] still the driver and IE5 problem

From: Nat Howard <nrh(at)pupworks(dot)com>
To: pmount(at)retep(dot)org(dot)uk, Georg(dot)Ritter(at)uibk(dot)ac(dot)at, pgsql-interfaces(at)hub(dot)org
Subject: RE: [INTERFACES] still the driver and IE5 problem
Date: 1999-09-10 00:00:35
Message-ID: 199909100000.UAA11264@spot.pupworks.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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(dot)Ritter(at)uibk(dot)ac(dot)at]
>Sent: Tuesday, June 15, 1999 2:32 PM
>To: pgsql-interfaces(at)hub(dot)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 automatically
initialize one the "DB2Driver"
classes upon loading. Some recent versions of the JDK for AIX
and OS/2 have this 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 code goes here
}
+
+ The ".newInstance()" above is apparently required by InterNet Explorer
+ and perhaps others.
+

Remember, this method restricts your code to just the postgresql database.

Browse pgsql-interfaces by date

  From Date Subject
Next Message Wahhabi Abdelkrim 1999-09-10 07:13:31 Re: [INTERFACES] Jdbc driver
Previous Message Sergio A. Kessler 1999-09-09 21:03:52 Re: [INTERFACES] odbc DM 3.5x