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);


Reply via email to