Re: java_objects and create table - Mailing list pgsql-jdbc

From Paul Thomas
Subject Re: java_objects and create table
Date
Msg-id 20030830101231.A28027@bacon
Whole thread Raw
In response to java_objects and create table  (Andrew Hart <andhart@btinternet.com>)
List 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 by date:

Previous
From: snpe
Date:
Subject: Re: Caching
Next
From: joe user
Date:
Subject: A JDBC bug or problem relating to string length in Java vs. PG (long)