I am trying to call a pre configured function using java code. This is the code i am using:
Class.forName("org.postgresql.Driver");
c = DriverManager.getConnection("jdbc:postgresql://" + ip + ":5432/" + db,
username, password);
c.setAutoCommit(false);
stmt = c.createStatement();
stmt.executeQuery( "SELECT public.myFunc ("1","2","3"));
stmt.close();
c.close();
The function itself has some validation and in the end an INSERT command. When I run the query from pgAdmin, I can see that the row is added, but when I run the same query as written above, nothing happens.
Also tried replacing the executeQuery with execute and executeUpdate.