Re: Doubt in Value insertion to an Array column through

Поиск
Список
Период
Сортировка
От Dave Cramer
Тема Re: Doubt in Value insertion to an Array column through
Дата
Msg-id 1047558607.1046.112.camel@inspiron.cramers
обсуждение исходный текст
Ответ на Doubt in Value insertion to an Array column through JDBC]  (Shanmugasundaram Doraisamy <shan@ceedees.com>)
Список pgsql-jdbc
PrepatedStatement.setArray( Array x) ?

Dave
On Wed, 2003-03-12 at 23:54, Shanmugasundaram Doraisamy wrote:
> Dear Group,
>         We are using Postgresql 7.3.1 on Redhat 7.3. The following is the problem I am facing:
>
> **************************************************************************************************
>     I am having a table with the following structure:
>
>     Table Name: address_using_array
>
>           COLUMN_NAME        TYPE    CONSTRAINT
>           -------------------------------------
>     1.     name              text       -
>     2.     address           text[]     -
>     3.     email             text       -
>
>
>     I tried the following combinations and I got the exceptions as a
> result (It is also given).
>     My java program Name is DBTestWithArrayColumn.java.
>
>         a)   PreparedStatement pStmt =
>                         connection.prepareStatement("insert into
> address_using_array values(?,{?,?},?)");
>              pStmt.setString(1,"Subramanian. S");
>              pStmt.setString(2,"First Street");
>              pStmt.setString(3,"Friends Nagar");
>              pStmt.setString(4,"ssm_pandu@ceedees.com");
>              if(pStmt.execute()) System.out.println("Successfully
> inserted");
>
>            Output:
>             ------
>                 java.sql.SQLException: ERROR:  parser: parse error at or
> near "{" at character 58
>                  at
> DBTestWithArrayColumn.main(DBTestWithArrayColumn.java:28)
>
>
>     The doubt is "How to insert values to the 'address' column through
> JDBC?".
>
>
> Thanking you,
> Shanmugasundaram Doraisamy
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 1: subscribe and unsubscribe commands go to majordomo@postgresql.org
--
Dave Cramer <Dave@micro-automation.net>


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

Предыдущее
От: Dave Cramer
Дата:
Сообщение: Re: Help!!
Следующее
От: Paul Guermonprez
Дата:
Сообщение: close Jdbc3PoolingDataSource connections ?