Can not access the public schema

Поиск
Список
Период
Сортировка
От M.Khaled
Тема Can not access the public schema
Дата
Msg-id 224738.17063.qm@web44809.mail.sp1.yahoo.com
обсуждение исходный текст
Список pgsql-jdbc
Hi,
I had installed postgresql-8.1.9, But when I tried to run any sql statement like the following:
(1)select * from <TableName>;
        or
(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
                  or
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:
 
Class.forName("org.postgresql.Driver");
   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>");
//or
//select * from <TableName>   
            while(resultSet.next()){
             System.out.println(resultSet.getString(1));
            }
  } catch (ClassNotFoundException e) {
   e.printStackTrace();
  } catch (SQLException e) {
   e.printStackTrace();
  } 
 
-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.
 
Thanks,
Mohamed.


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

В списке pgsql-jdbc по дате отправления:

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: Problem calling stored function
Следующее
От: "Francesco Storti"
Дата:
Сообщение: Re: Problem calling stored function