Skip site navigation (1) Skip section navigation (2)

Can not access the public schema

From: "M(dot)Khaled" <mohamed_mohamed_186(at)yahoo(dot)com>
To: pgsql-jdbc(at)postgresql(dot)org
Subject: Can not access the public schema
Date: 2008-01-18 07:53:10
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-jdbc
  I had installed postgresql-8.1.9, But when I tried to run any sql statement like the following:
  (1)select * from <TableName>;
  (2)select * from public.<TableName>;
   on the query tool to access any table inside the public schema I got the following error:
  ERROR:  relation "<TableName>" does not exist
  ERROR:  relation "public.<TableName>" does not exist
  thought I am logging in with a superuser account.
  -The second part of the problem is that I wrote a JDBC code to access any table inside the public schema and I got the same errors.And the following are the lines of code I wrote:
   Connection connection = DriverManager.getConnection("jdbc:postgresql://localhost/<DataBaseName>?user=user&password=password");   
   System.out.println("connection>>>>>>>>>>>>> "+connection);
   Statement statement=connection.createStatement();   
   ResultSet resultSet=statement.executeQuery("select * from public.<TableName>");
  //select * from <TableName>   
  } catch (ClassNotFoundException e) {
  } catch (SQLException e) {
  -I ensured that I have a connection to the DataBase by printing the connection to the console as you see.And the connection object was printed.
  -Please advice.

Be a better friend, newshound, and know-it-all with Yahoo! Mobile.  Try it now.

pgsql-jdbc by date

Next:From: Francesco StortiDate: 2008-01-18 11:35:12
Subject: Re: Problem calling stored function
Previous:From: Mischa SandbergDate: 2008-01-17 23:52:33
Subject: Re: [ADMIN] postgresql in FreeBSD jails: proposal

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group