R: "\d tablename" to get column name, and column type by using JDBC

Поиск
Список
Период
Сортировка
Искать
От
Leonardo Francalanci
Тема
R: "\d tablename" to get column name, and column type by using JDBC
Дата
Msg-id
KNEFJLENOMMIGOKNCBFAMEFJENAA.lfrancalanci@simtel.ie
Ответ на
Список
Дерево обсуждения
"\d tablename" to get column name, and column type by using JDBC Ying Lu <ying_lu@cs.concordia.ca>
Re: "\d tablename" to get column name, and column type by using JDBC Paul Thomas <paul@tmsl.demon.co.uk>
Re: "\d tablename" to get column name, and column type by Doug McNaught <doug@mcnaught.org>
Re: "\d tablename" to get column name, and column type Ying Lu <ying_lu@cs.concordia.ca>
R: "\d tablename" to get column name, and column type by using JDBC "Leonardo Francalanci" <lfrancalanci@simtel.ie>
have a look at java.sql.Connection.getDatabaseMetadata()
(and the object, java.sql.DatabaseMetaData it returns)


> -----Messaggio originale-----
> Da: pgsql-general-owner@postgresql.org
> [mailto:pgsql-general-owner@postgresql.org]Per conto di Ying Lu
> Inviato: giovedì 2 settembre 2004 16.53
> A: pgsql-general@postgresql.org
> Oggetto: [GENERAL] "\d tablename" to get column name, and column type by
> using JDBC
>
>
> Hello,
>
> Under mysql, we have "desc tablename" to get the detail information
> about a table. My question is about to get column name, and column type
> for a specific table under PostgreSQL through JDBC.
>
> Assume we have a table named "test". Under PSQL, we can input "\d test"
> to see the details about table "test" successufully.  However, my main
> purpose is trying to get column name, column name of a table through JDBC.
>
> The following is the java code, by which I always get "   ERROR: syntax
> error at or near "\"      ".
>
> Some clues?
> Emi
>
> ==================================================================
> ==================
>             Connection connection     = DriverManager.getConnection(url,
> "abc", "abc");      //username and pwd is "abc"
>             Statement stmt             = connection.createStatement();
>             String query                = "\\d test";
>             System.out.println("query: "+query);
>             ResultSet rs                 = stmt.executeQuery(query);
>
>
>
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 4: Don't 'kill -9' the postmaster
>

В списке pgsql-general по дате отправления
От: Ennio-Sr
Дата:
От: Doug McNaught
Дата:
FAQ