Обсуждение: RE: using large objects with jdbc

Поиск
Список
Период
Сортировка

RE: using large objects with jdbc

От
Peter Mount
Дата:
Ok, first you run it from the src/interface/jdbc directory, not from within
example.

Then you run it using:
java example.blobtest jdbc:postgresql:mydb user passwd

Where mydb is your database, user & passwd are obvious.

To get some extra debug info, add d to the end.

Also, make sure that the current directory is in the CLASSPATH.

Peter

-- 
Peter Mount
Enterprise Support Officer, Maidstone Borough Council
Email: petermount@it.maidstone.gov.uk
WWW: http://www.maidstone.gov.uk
All views expressed within this email are not the views of Maidstone Borough
Council


-----Original Message-----
From: Manika dey [mailto:bithi@plasma.ernet.in]
Sent: Friday, August 25, 2000 3:28 PM
To: postgres-inter
Subject: [INTERFACES] using large objects with jdbc



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              | ------------------------------------------------------------------ 
 



                                                     




RE: using large objects with jdbc

От
Manika dey
Дата:
Hi, thanks  it worked from postgres directory above example dir ie:  from postgres/postgresql-6.3.2/src/interfaces/jdbc

but i am having the following problem  * if i compile if it form my home dir by copying it in anyother   by commenting
thesentence package example    i get error of Class LargeObjectManager not found in type declaration.   int oid =
                  
 
lobj.create(LargeObjectManager.READ|LargeObjectManager.WRITE);
* it moves only those files to database which in the dir of postgres  and not the ones which are in my home dir
how can i solve this problem
-------------------------------------------------------------------

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              | ------------------------------------------------------------------ 
 



                                                     








RE: RE: using large objects with jdbc

От
Peter Mount
Дата:
Are you importing the postgresql.largeobject package?

ie

import postgresql.largeobject.*;

Peter

-- 
Peter Mount
Enterprise Support Officer, Maidstone Borough Council
Email: petermount@maidstone.gov.uk
WWW: http://www.maidstone.gov.uk
All views expressed within this email are not the views of Maidstone Borough
Council


-----Original Message-----
From: Manika dey [mailto:bithi@plasma.ernet.in]
Sent: Friday, August 25, 2000 10:19 PM
To: Peter Mount
Cc: postgres-inter
Subject: [INTERFACES] RE: using large objects with jdbc



Hi, thanks  it worked from postgres directory above example dir ie:  from postgres/postgresql-6.3.2/src/interfaces/jdbc

but i am having the following problem  * if i compile if it form my home dir by copying it in anyother   by commenting
thesentence package example    i get error of Class LargeObjectManager not found in type declaration.   int oid =
                  
 
lobj.create(LargeObjectManager.READ|LargeObjectManager.WRITE);
* it moves only those files to database which in the dir of postgres  and not the ones which are in my home dir
how can i solve this problem
-------------------------------------------------------------------

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              | ------------------------------------------------------------------ 
 



                                                     







RE: using large objects with jdbc

От
Manika dey
Дата:
Hi, can storing and retrieving of data from postgresql-6.3.2  be  done distributedly using corba (e.g visibroker for
java)
 
if so can anyone give a sample of it
 thank  you manika


                                                     





Re: using large objects with jdbc

От
"Peter Mount"
Дата:
[Reply from retep.org.uk as I can't seem to post from work anymore, incase
you see two replies to this.]...

In the source (src/interfaces/jdbc/example/corba) there's an example of
using Postgresql & JDBC using corba. It only works for JDK1.2 and later, and
was included in the source since 6.5.1. In theory the example should work
with the 6.3.x driver as it uses only standard API calls.

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: "Manika dey" <bithi@plasma.ernet.in>
To: "Peter Mount" <petermount@it.maidstone.gov.uk>
Cc: "postgres-inter" <pgsql-interfaces@postgresql.org>
Sent: Tuesday, September 05, 2000 5:23 PM
Subject: RE: [INTERFACES] using large objects with jdbc


>
> Hi,
>   can storing and retrieving of data from postgresql-6.3.2  be
>   done distributedly using corba (e.g visibroker for java )
>
>  if so can anyone give a sample of it
>
>   thank  you
>   manika
>
>
>
>
>
>
>
>
>



RE: using large objects with jdbc

От
Peter Mount
Дата:
The driver won't be compatible, but if you look at the source to the 6.5.x
series you'll find a directory called example/corba. In there is an example
of using postgresql, jdbc & corba together.

PS: This only works for JDK1.2 and later.

Peter

-- 
Peter Mount
Enterprise Support Officer, Maidstone Borough Council
Email: petermount@maidstone.gov.uk
WWW: http://www.maidstone.gov.uk
All views expressed within this email are not the views of Maidstone Borough
Council


-----Original Message-----
From: Manika dey [mailto:bithi@plasma.ernet.in]
Sent: Tuesday, September 05, 2000 5:23 PM
To: Peter Mount
Cc: postgres-inter
Subject: RE: [INTERFACES] using large objects with jdbc



Hi, can storing and retrieving of data from postgresql-6.3.2  be  done distributedly using corba (e.g visibroker for
java)
 
if so can anyone give a sample of it
 thank  you manika


                                                     




problem largeobject

От
Manika dey
Дата:
Hi, i am at present working on postgresql6.3 on sun solaris2.5 i want help  for my  following problem :
* how can i  transfer data from window NT/window95 to the database of postgresql6.3 on sun solaris2.5* the above
mentionedmachines are all on the same network.* i am using jdbc driver with jdk1.1.4 with servlet for my present
work.
 i will be thankful if some one can suggest me a solution for this  as soon as possible.   with regards manika
-------------------------------------------------------------------

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              | ------------------------------------------------------------------ 
 



                                                     





Re: problem largeobject

От
Igor Gavriloff
Дата:
Hi,
  You can transfer data to the server thru an fileupload field in your
forms, then the web server will make that file available at a temp
location to the cgi. I use PHP for my programs, for me it's quite simple
to track where are the files, probably there must be an specification in
the servlets api on how to deal with fileuploads. Here we have machines
running Solaris, Linux and Windows, and this kind of treatment is
working just fine in our tests (this implementation's platform
independent). Just watch out the configs around where it sets a max size
that can be uploaded (servers, cgis...).  Just on remark: some OSs have a limitation in the max ammount of
files that can reside in one single directory: when it's reached it
starts to have an slower acces in that dir as more files are put into
it.  The "lo" interface puts all the files into the /...../pgsql/data/base
directory, so, in a system with heavy use of large objects, (as mine's
going to be) it would degradate the performance of the backend. I'm also
running Solaris where I run the postgres backend and the web daemon
(Apache), and I've found no information on how much files I can put into
a single dir, but had the information (from a person that works here)
that Solaris has an maximum ammount of files per filesystem (thought he
couldn't tell me how much), so, the possibility of having an limit in a
single dir isn't discarted.  Just for an example: Squid (an proxy server for the unix platform)
create several sub-dirs (and a couple more in each of them) in the main
cache dir to avoid system degradation. As I have noticed this in the few
days, I'm going to write my own code on how to deal with those files -
beside using the lo interface provided - before my system enters in a
production state. Another point it that it's hard to track an lo object
in a case of a system crash. Is it too much paranoya or not? Any
comments are welcome.

Igor.

Manika dey wrote:

> Hi,
>   i am at present working on postgresql6.3 on sun solaris2.5 i want help
>   for my  following problem :
>
>  * how can i  transfer data from window NT/window95 to the database
>   of postgresql6.3 on sun solaris2.5
>  * the above mentioned machines are all on the same network.
>  * i am using jdbc driver with jdk1.1.4 with servlet for my present
>    work.
>
>   i will be thankful if some one can suggest me a solution for this
>   as soon as possible.
>
>   with regards
>   manika
>

--
Anyone can make an omelet with eggs.  The trick is to make one with
none.



using large objects with jdbc

От
Manika dey
Дата:
I am using largeobject  for storing my datafiles in database
postgresql6.3.2

but when I try  to retrieve my data from database to a file.i get the following type of error

Exception caught.
java.sql.SQLException: Fastpath: ERROR:  lo_tell: invalid large object
descriptor (0)
java.sql.SQLException: Fastpath: ERROR:  lo_tell: invalid large object
descriptor (0)
       at postgresql.fastpath.Fastpath.fastpath(Fastpath.java:135)       at
postgresql.fastpath.Fastpath.fastpath(Fastpath.java:181)      at
postgresql.fastpath.Fastpath.getInteger(Fastpath.java:193)      at
postgresql.largeobject.LargeObject.tell(LargeObject.java:206)      at
postgresql.largeobject.LargeObject.size(LargeObject.java:221)      at dfile.<init>(dfile.java:86)       at
dfile.main(dfile.java:128)
how can i get rid of the above mentioned  errors.

manika


-------------------------------------------------------------------

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              | FAX --- 69017 ------------------------------------------------------------------




                                                     






Re: using large objects with jdbc

От
Thomas Lockhart
Дата:
> how can i get rid of the above mentioned  errors.

PostgreSQL 6.3.2 is *very* old, and a lot has been improved since that
release (including many improvements and fixes in the large objects).
Upgrading to 7.0.2 would be a very good idea, and most likely will make
the LO errors go away.
                   - Thomas


RE: using large objects with jdbc

От
Manika dey
Дата:
when i try to use jdbc interface of postgres from my directory it gives
me the errors mentioned below , but the example programs in postgres
directory compiles and runs prefectly (when login as postgres)

error: Can't write:
/users16/home/postgres/postgresql-6.3.2/src/interfaces/jdbc/postgresql/largeobject/LargeObjectManager.class
error: Can't write:
/users16/home/postgres/postgresql-6.3.2/src/interfaces/jdbc/postgresql/
Connection.class
error: Can't write:
/users16/home/postgres/postgresql-6.3.2/src/interfaces/jdbc/postgre
sql/largeobject/LargeObject.class
error: Can't write:
/users16/home/postgres/postgresql-6.3.2/src/interfaces/jdbc
/postgresql/fastpath/Fastpath.class
error: Can't write:
/users16/home/postgres/postgresql-6.3.2/src/interfaces/jdbc/
Bpostgresql/ResultSet.class
error: Can't write:
/users16/home/postgres/postgresql-6.3.2/src/interfaces/jdbc/postgresql/fastpath/FastpathArg.class
error: Can't write:
/users16/home/postgres/postgresql-6.3.2/src/interfaces/jdbc/postgresql/PG_Stream.class
error: Can't write:
/users16/home/postgres/postgresql-6.3.2/src/interfaces/jdbc/postgresql/
Driver.class
error: Can't write:
/users16/home/postgres/postgresql-6.3.2/src/interfaces/jdbc/postgresql/util/UnixCrypt.class
error: Can't write:
/users16/home/postgres/postgresql-6.3.2/src/interfaces/jdbc/postgresql/
Statement.class
error: Can't write:
/users16/home/postgres/postgresql-6.3.2/src/interfaces/jdbc/postgresql/
PreparedStatement.class

-------------------------------------------------------------------

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              | FAX --- 69017 ------------------------------------------------------------------




                                                     






RE: using large objects with jdbc

От
Manika dey
Дата:
Hi,
 in the very prevoius mail i mailed you some error i have  rectified it but i am getting the following error  now 
Opening large object 25121
Opening test destination object
Copying large object to file
Exception caught.
java.sql.SQLException: Fastpath: ERROR:  lo_tell: invalid large object
descriptor (0)

java.sql.SQLException: Fastpath: ERROR:  lo_tell: invalid large object
descriptor (0)
       at postgresql.fastpath.Fastpath.fastpath(Fastpath.java:135)       at
postgresql.fastpath.Fastpath.fastpath(Fastpath.java:181)      at
postgresql.fastpath.Fastpath.getInteger(Fastpath.java:193)      at
postgresql.largeobject.LargeObject.tell(LargeObject.java:206)      at
postgresql.largeobject.LargeObject.size(LargeObject.java:221)      at dfile.<init>(dfile.java:86)       at
dfile.main(dfile.java:128)


it writes fine to database but while reading it gives the above mentioned
error
i will be thankful if somebody can help solve this problem .thanks
-------------------------------------------------------------------

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              | FAX --- 69017 ------------------------------------------------------------------