JDBC issue

From: Stephen Davies <sdavies(at)sdc(dot)com(dot)au>
To: pgsql-general(at)lists(dot)postgresql(dot)org
Subject: JDBC issue
Date: 2026-07-12 07:01:12
Message-ID: 5cce543a-3589-4a82-a3df-b6943b21ce21@sdc.com.au
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-general

I have several JDBC-based programs on my Rocky Linux 9.8 box.
Postgresql 17.10 and JDBC 42.7.2.
As of today, these programs all fail because the JDBC connections do not
work and the following code example produces no output except:

"org.apache.jasper.JasperException: An exception occurred processing
[/jsp/browsewineries.jsp] at line [48] st1 is null".

There have been several system updates recently but not Postgresql so I
have no idea what might have changed to cause these errors.

<%@ page
import="java.sql.*,
jakarta.servlet.http.HttpServlet,
jakarta.servlet.http.HttpServletResponse"
%>
<% int res = 0;
String url = "jdbc:postgresql:cellar";
String s2="select id,name from winery order by name";
Connection conn1 = null;
Statement st1 = null;

try {
Class.forName("org.postgresql.Driver");
conn1 = DriverManager.getConnection(url, "scldad", "");
if (conn1 == null)
System.out.println("Conn1 Failed!");
} catch(Exception e) {
System.out.println("Conn Failed!");
e.printStackTrace();
}
try {
st1 = conn1.createStatement();
if (st1 == null)
System.out.println("State1 Failed!");
} catch(Exception e) {
System.out.println("State Failed!");
e.printStackTrace();
}
ResultSet rs = st1.executeQuery(s2);

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Christophe Pettus 2026-07-12 07:13:36 Re: JDBC issue
Previous Message Tom Lane 2026-07-11 20:31:57 Re: Identifying build options