Re: java_objects and create table

Поиск
Список
Период
Сортировка
От Paul Thomas
Тема Re: java_objects and create table
Дата
Msg-id 20030830101231.A28027@bacon
обсуждение исходный текст
Ответ на java_objects and create table  (Andrew Hart <andhart@btinternet.com>)
Список pgsql-jdbc
On 29/08/2003 16:02 Andrew Hart wrote:
> I am trying to store a java_object into a database using code:
> try {
>    s.executeUpdate( "create table regions2 ( region java_object );"  );
> }
> catch (SQLException e) {
>    System.out.println("Error creating:" + e.getMessage());
> }
>
>
> Error creating:ERROR:  Unable to locate type name 'java_object' in
> catalog
> JDK14 pg73jdbc3 pg7.2.1
>
> What is going wrong?  I would assume that the java_object type is not
> supported but is there an alternative type so that I can use a prepared
> statement and a setObject( myRegion ) call to add my object to the
> database?

AFAIK, there's no such data type as java_object and I'm not sure how you
would be led to believe otherwise. It might be possible to serialize your
object abd store it as a Large Object (see section 8.6 Storing Binary Data
in your PostgrSQL docs).

--
Paul Thomas
+------------------------------+---------------------------------------------+
| Thomas Micro Systems Limited | Software Solutions for the Smaller
Business |
| Computer Consultants         |
http://www.thomas-micro-systems-ltd.co.uk   |
+------------------------------+---------------------------------------------+

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

Предыдущее
От: snpe
Дата:
Сообщение: Re: Caching
Следующее
От: joe user
Дата:
Сообщение: A JDBC bug or problem relating to string length in Java vs. PG (long)