Skip site navigation (1) Skip section navigation (2)

Re: JDBC PostgreSQhelL

From: Barry Lind <barry(at)xythos(dot)com>
To: acshafer(at)moon(dot)hec(dot)utah(dot)edu
Cc: pgsql-jdbc(at)postgresql(dot)org
Subject: Re: JDBC PostgreSQhelL
Date: 2001-10-18 16:46:46
Message-ID: 3BCF0776.9060307@xythos.com (view raw or flat)
Thread:
Lists: pgsql-jdbc
The problem is that you are using current development code with 
instructions that are written for 7.1.

You can either get the 7.1 jdbc drivers which should work according to 
the documentation you are using, or you can use the 'compatible' 
parameter to set the behavior in the 7.2 driver back to what it was in 7.1.

I haven't yet updated the docs for the changes put in place in the 7.2 code.


thanks,
--Barry



acshafer(at)moon(dot)hec(dot)utah(dot)edu wrote:

> 
> I'm a getting a bit flustered with my old friend Postgresql.  Everything
> was fine and dandy until I decided I needed to use large objects.
> 
> At first, after following the documentation, I was getting InputStream not
> supported as a parameter.  I started looking around and found some things
> in the archives that said streams aren't supported until version 7.1. (the
> fact that the documentation gives an example using streams to use large
> objects going at least back to 6.5 is lame, why not just add a note that
> this isn't implemented?  Wouldn't that save the most headaches?) Ok, no
> problem, I'm running 7.0, I can upgrade to 7.1.  After wrestling the RPMs 
> into submission, finally got 7.1.3 up and running.  Ok, need new drivers
> now, ok, no problems, add them to the classpath and. . . now I'm getting
> some new funk:
> 
> java.sql.SQLException: ERROR:  oidin: error in ". . . a big long string
> representing the file. . . ": can't parse " . . .same big long string,
> again. . ."
> 
> at org.postgresql.core.QueryExecutor.execute(QueryExecutor.java:88)
> at org.postgresql.Connection.ExecSQL(Connection.java:356)
> . . .
> 
> Here is the gist of the code (should look pretty familiar, it's straight 
> out of the documentation):
> 
> File file = new File("mytest.blob");
> FileInputStream fis = new FileInputStream(file);
> PreparedStatement ps = con.prepareStatement("insert into blobtest
> values (?,?)");
> ps.setString(1, file.getName());
> ps.setUnicodeStream(2, fis, (int)file.length()); 
> ps.executeUpdate(); 
> 
> 
> Can I get a little direction?  Any idea why I'm getting this error or how
> to make it go away?
> 
> I would appreciate if anyone could supply an example or two of working
> code, inserting and recalling files from the db using JDBC.  I would
> prefer to avoid the LargeObjectManager if possible, but if any one would
> care to supply an example of code doing the same thing the
> org.postgresql.largeobject package, I'd like to look through that also.
> 
> Also, Is there a javadoc of all the packages in the .jar file for
> postgres? 
> 
> Sincerely,
> 
> Andrew
> 
> 
> ---------------------------(end of broadcast)---------------------------
> TIP 2: you can get off all lists at once with the unregister command
>     (send "unregister YourEmailAddressHere" to majordomo(at)postgresql(dot)org)
> 
> 



In response to

Responses

pgsql-jdbc by date

Next:From: Peter EisentrautDate: 2001-10-18 17:41:11
Subject: Re: J2SE 1.4 and other patches
Previous:From: rootDate: 2001-10-18 15:39:46
Subject: Re: problem with Chinese

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group