Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1gXudO-0000qQ-NO for pgsql-general@arkaria.postgresql.org; Fri, 14 Dec 2018 21:04:34 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1gXudN-0001CD-Dg for pgsql-general@arkaria.postgresql.org; Fri, 14 Dec 2018 21:04:33 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1gXudN-0001C5-2P for pgsql-general@lists.postgresql.org; Fri, 14 Dec 2018 21:04:33 +0000 Received: from mail-pf1-x435.google.com ([2607:f8b0:4864:20::435]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1gXudK-00055P-Eh for pgsql-general@postgresql.org; Fri, 14 Dec 2018 21:04:31 +0000 Received: by mail-pf1-x435.google.com with SMTP id y126so3389549pfb.4 for ; Fri, 14 Dec 2018 13:04:30 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:message-id:mime-version:subject:date:in-reply-to:cc:to :references; bh=FU3mOxaxgL0bJ+You+KewBuCF35PMe+8puRpD5aIdlo=; b=CTfnV0CO3FHHGlerKtQkEWIz/2w1221zoogJ0ThCz2VAAsdaISZFEjmva9G4YkMHXa lnKD8gPiTMsxHyp3suO8fDVTtfUR3+9x9L1cv7y4PMBtMSOySVmQybwpdfJl7xVp0Urf ef2RooZM0YYIfURMHPpchINhWbakbesG6wdowVoSJDMTqFJAsyxhuel++v/LxXiWWts8 N72CwuMEeB93v3lk3C2I7TysrDOTADQ3V2yjX92lJInqyXYrJzEm1xfjVPQNFG/wbcgS qeNcVwaxwa5Dby9VsSwLKh+vklATlp7k1kMC5m3uxYx0PiC348iZuXznjsNaBrSru+5e ydMg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:message-id:mime-version:subject:date :in-reply-to:cc:to:references; bh=FU3mOxaxgL0bJ+You+KewBuCF35PMe+8puRpD5aIdlo=; b=CFYCEki9/bqCAfn/RBO3WHYihvLUu0C4Sw7n4ynYKF1X0XoLXj1b/vUoenRuPJOLkr 5h6ayEQ1EtRkSV2s4SJ5IuKbMEIzwXEE0NPhR2QVw77JF+04dgZtoKGByddFYNKfNqE+ xTP+pS5JaZfFssQTjU1sKxDo3MFVlhGp8xqEJe74ZMdjunQpYLxf6kHShWOzO9IuzTHa pZ/r1hoG95fOn0Jo9YVasK3gOSHB442nZhEkpv2koOE9KZEq1HRIMbWIHzDb/xtPbxEU eTWjmW8hK9PkEetfXDU1j3UlfTgPDL3DE8yRZ+uCK00/q1YQwIEusKtrSURYe50NJ7IV m6FQ== X-Gm-Message-State: AA+aEWbosVgRPUiB4xPfQOzDG9ctrfY+yiWG8VDJTP4wTvDeGpJd573b CGZRPJ42wm03qwhciJ0CXI/oJank X-Google-Smtp-Source: AFSGD/XbL8Yyq0Q9Nndah+1r5lWSUJlEKVT0UPJtkSV5+6lMtMqxDfFX75pSv4gcxcBpzH3riae+GQ== X-Received: by 2002:a63:c303:: with SMTP id c3mr4068248pgd.268.1544821469403; Fri, 14 Dec 2018 13:04:29 -0800 (PST) Received: from kitselas.uconnect.utah.edu ([155.98.131.6]) by smtp.gmail.com with ESMTPSA id v5sm9926755pgn.5.2018.12.14.13.04.28 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 14 Dec 2018 13:04:28 -0800 (PST) From: Rob Sargent Message-Id: <4A34E53B-49DC-4E7D-9802-645EDAF8443E@gmail.com> Content-Type: multipart/alternative; boundary="Apple-Mail=_4A69A986-4F57-4B22-AB7B-C8891B0E29AF" Mime-Version: 1.0 (Mac OS X Mail 12.1 \(3445.101.1\)) Subject: Re: loading jdbc Driver in servlet Date: Fri, 14 Dec 2018 14:04:28 -0700 In-Reply-To: <516D35C9-36C4-4F25-A18A-ADDF55D0BD0A@gmail.com> Cc: "pgsql-general@postgresql.org" To: Dave Cramer References: <5182a498-cfde-e7a3-998d-fea79bedaf35@gmail.com> <516D35C9-36C4-4F25-A18A-ADDF55D0BD0A@gmail.com> X-Mailer: Apple Mail (2.3445.101.1) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk --Apple-Mail=_4A69A986-4F57-4B22-AB7B-C8891B0E29AF Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 > On Dec 14, 2018, at 2:02 PM, Rob Sargent = wrote: >=20 >=20 >=20 >> On Dec 14, 2018, at 1:30 PM, Dave Cramer > wrote: >>=20 >> Strange, I wouldn't think so, but then I haven't used a raw servlet = for so long I have no idea. >>=20 >>=20 >> Dave Cramer >>=20 >> davec@postgresintl.com >> www.postgresintl.com >>=20 >> On Fri, 14 Dec 2018 at 13:29, Rob Sargent > wrote: >> Using java 1.8, postgresql-42.1.4.jar, embedded tomcat 9 >>=20 >> It appears to me that I need to make the call = "Class.forName("org.postgresql.Driver)" when the entry is in a servlet. = Is this expected, within a servlet, or is this just post hoc ergo = propter hoc at it finest and I changed something else (wittingly or = not). Same code outside of servlet does not need the forced loading of = the class and the manual claims it's not need after java 1.6 >>=20 > I too am suspicious. But the vagaries of javax are daunting. > But if I comment it out, as just now, =E2=80=9CNo suitable driver = found...=E2=80=9D. I was days playing with configuration and such think = that this very specific error message was telling me my CLASSPATH was = wrong. >=20 > I wonder if I have an old javax installation (which I put in place = just recently). >=20 >=20 I=E2=80=99m using javax.servlet-api-3.1.0.jar >=20 >=20 --Apple-Mail=_4A69A986-4F57-4B22-AB7B-C8891B0E29AF Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset=utf-8

On Dec 14, 2018, at 2:02 PM, Rob Sargent <robjsargent@gmail.com> wrote:



On Dec 14, 2018, at 1:30 PM, Dave Cramer <pg@fastcrypt.com> = wrote:

Strange, I wouldn't think so, but then I haven't = used a raw servlet for so long I have no idea.


On Fri, 14 Dec 2018 at 13:29, Rob Sargent <robjsargent@gmail.com> wrote:
=20 =20 =20

Using = java 1.8, postgresql-42.1.4.jar, embedded tomcat 9

It appears to me that I need = to make the call "Class.forName("org.postgresql.Driver)" when the entry is in a servlet.  Is this expected, within a servlet, or is this = just post hoc ergo propter hoc at it finest and I changed something else (wittingly or not).  Same code outside of servlet does = not need the forced loading of the class and the manual claims it's not need after java 1.6

I too am suspicious.  But the vagaries of = javax are daunting.
But if I comment it out, as just now, = =E2=80=9CNo suitable driver found...=E2=80=9D.  I was days playing = with configuration and such think that this very specific error message = was telling me my CLASSPATH was wrong.

I wonder if I have an old javax = installation (which I put in place just recently).


I=E2=80=99m using = javax.servlet-api-3.1.0.jar



= --Apple-Mail=_4A69A986-4F57-4B22-AB7B-C8891B0E29AF--