Обсуждение: using large objects with jdbc/odbc
I am successfully using large objects in postgres with the latest version of postgtres and the latest jdbc driver (thanks to a lot of help from this list :-)) However, I need to make sure that my table is accessible from both jdbc and odbc drivers. I need to make sure that programs that utilize the odbc driver for postgres can also access large object data in the same table that the jdbc driver is accessing the data. So I thought that I would have to define the large object field as type 'lo' instead of 'oid'. But then jdbc wont recognize it. So I tried defining a type in the org.postgres.Field.java of 'lo' as VARBINARY and also tried it as INTEGER, hoping that the driver would then recognize the type of lo in the table but it did not work and I get the following error: Attribute 'fieldA' is of type 'lo' but expression is of type 'int4' Any ideas on this? Is it possible to even do this or should I go back to the drawing board? Thanks, John -- ******************************** ** John Thorhauer ** jthorhauer@phoenixcolor.com ********************************
This error is from the backend. Its saying it doesn't know how to convert lo to and from int4. You'll need to create some functions to handle this conversion. Peter -- Peter T Mount peter@retep.org.uk, me@petermount.com Homepage: http://www.retep.org.uk Contact details: http://petermount.com PostgreSQL JDBC: http://www.retep.org.uk/postgres/ Java PDF Generator: http://www.retep.org.uk/pdf/ ----- Original Message ----- From: "John Thorhauer" <jthorhauer@phoenixcolor.com> To: "postgres-inter" <pgsql-interfaces@postgresql.org> Sent: Monday, August 21, 2000 4:52 PM Subject: [INTERFACES] using large objects with jdbc/odbc > I am successfully using large objects in postgres with the latest > version of postgtres and the latest jdbc driver (thanks to a lot of help > from this list :-)) However, I need to make sure that my table is > accessible from both jdbc and odbc drivers. I need to make sure that > programs that utilize the odbc driver for postgres can also access large > object data in the same table that the jdbc driver is accessing the > data. > > So I thought that I would have to define the large object field as type > 'lo' instead of 'oid'. But then jdbc wont recognize it. So I tried > defining a type in the org.postgres.Field.java of 'lo' as VARBINARY and > also tried it as INTEGER, hoping that the driver would then recognize > the type of lo in the table but it did not work and I get the following > error: > > Attribute 'fieldA' is of type 'lo' but expression is of type 'int4' > > Any ideas on this? Is it possible to even do this or should I go back > to the drawing board? > > Thanks, > John > > -- > ******************************** > ** John Thorhauer > ** jthorhauer@phoenixcolor.com > ********************************
Hi, i am having postgresql 6.3.2 with jdk1.1.4 on solaris platform i tried to run  the example of blobtest.java in
directorypostgres/postgresql-6.3.2/src/interfaces/jdbc/example    i get error of : --Can't find class blobtest i have
compiledit successfully 
 
can anyone help me out of it
thanksmanika
-------------------------------------------------------------------
From:-                          | Ms. Manika Dey.                |Ph.No:--Engineer-SC (Comp. Tech.)      | IPR -- 02712
-69276 I.P.R                          |          EXT 336,315BHAT, GANDHINAGAR              | Residence -- 079 -
6619967Gujrat-- 382 428              | ------------------------------------------------------------------