I am using Java, Weblogic, postgressql, and sql2o.
I am selecting from a table named folder.
select * from folder
works fine in pgadmin, however, every variation I try from Java gives me the following exception: Caused by: org.postgresql.util.PSQLException: ERROR: relation "folder" does not exist
I've tried every variation: public.folder, "folder", folder, and "public"."folder"... nothing works.
here is my code:
public Folder get(long folderId) {
String sql = "select * from \"public\".\"folder\" where folder_id = 1";
try (Connection connection = helper.open()) {
Query query = connection.createQuery(sql);
return populate(query.executeAndFetchFirst(Folder.class));
}
}
EDIT: Here is the create script
CREATE TABLE public.folder
(
folder_id bigint NOT NULL,
[...]
CONSTRAINT folder_pkey PRIMARY KEY (folder_id)
)
WITH (
OIDS=FALSE
);
ALTER TABLE public.folder
OWNER TO postgres;
Any insight into what I am doing wrong?