I want to throw PSQLException in my Java program.
throw new PSQLException("serializable error", new PSQLState("40001"));
However, Eclipse doesn't allow compile my java program, getting an error:
Cannot instantiate the type PSQLState
I use Postgres SQL database in the program. I have postgresql-42.2.5.jar library in the project. I imported these two classes, didn't help.
import org.postgresql.util.PSQLException; import org.postgresql.util.PSQLState;