pg.ddx.io pgsql-interfaces@postgresql.org mailing list archive
help / color / mirror / Atom feedjdbc fastpath error & Z error (URGENT NEED!!!)
2+ messages / 2 participants
[nested] [flat]
* jdbc fastpath error & Z error (URGENT NEED!!!)
@ 2001-02-11 21:36 Mark <bef5471@iperbole.bologna.it>
2001-02-13 10:02 ` Re: [INTERFACES] jdbc fastpath error & Z error (URGENT NEED!!!) Peter T Mount <peter@retep.org.uk>
0 siblings, 1 reply; 2+ messages in thread
From: Mark @ 2001-02-11 21:36 UTC (permalink / raw)
To: pgsql-interfaces
Hy, Postgresql community!
I'm using:
Linux RedHat6.2,
PostgreSql6.5.3+jdbc6.5-1.2,
jdk1.2.2
(AND I CAN'T CHANGE THIS "KIT")
I've got the below java program and when I type:
# javac PicImmitter.java , it's all ok.
But my problem occours when I run:
#java PicImmitter
..........and this is the error output:
"FastPath protocol error: Z
at postgresql.fastpath.Fastpath.fastpath(Fastpath.java:159)
at postgresql.fastpath.Fastpath.fastpath(Fastpath.java:188)
at postgresql.fastpath.Fastpath.getInteger(Fastpath.java:200)
at
postgresql.largeobject.LargeObjectManager.create(LargeObjectManager.java:162
)
at postgresql.jdbc2.PreparedStatement.setBytes(PreparedStatement.java:298)
at ProvaPicIn.<init>(ProvaPicIn.java:48)
at ProvaPicIn.main(ProvaPicIn.java:11) "
What can I do, exactly? My Program is:
import java.awt.*;
import java.io.*;
import java.io.FileInputStream;
import java.sql.*;
import postgresql.largeobject.*;
import java.io.IOException;
public class PicImmitter extends Frame{
public static void main(String args[])
{
PicImmitter app = new PicImmitter();
System.exit(0);
}
public PicImmitter()
try{
Class.forName("postgresql.Driver");
Connection conn=DriverManager.getConnection("jdbc:postgresql:best",
"Myuser","Mypwd");
FileInputStream fis = new FileInputStream("015.jpg");
int nBytes = fis.available();
byte [] buff= new byte[nBytes];
int bytesPhoto = fis.read(buff,0,nBytes);
String photo = new String(buff);
conn.setAutoCommit(false);
PreparedStatement ps = conn.prepareStatement("update players set
image = ? where playercode=? ");
ps.setBytes(1,photo.getBytes());
ps.setInt(2,15);
ps.executeUpdate();
fis.close();
ps.close();
conn.setAutoCommit(true);
conn.close();
}catch(Exception ex){
ex.printStackTrace();
}
}
}
THANK'S A LOT
MARCO FROM ITALY
^ permalink raw reply [nested|flat] 2+ messages in thread
* Re: [INTERFACES] jdbc fastpath error & Z error (URGENT NEED!!!)
2001-02-11 21:36 jdbc fastpath error & Z error (URGENT NEED!!!) Mark <bef5471@iperbole.bologna.it>
@ 2001-02-13 10:02 ` Peter T Mount <peter@retep.org.uk>
0 siblings, 0 replies; 2+ messages in thread
From: Peter T Mount @ 2001-02-13 10:02 UTC (permalink / raw)
To: Mark <bef5471@iperbole.bologna.it>; +Cc: pgsql-jdbc@postgresql.org
Quoting Mark <bef5471@iperbole.bologna.it>:
redirecting to jdbc list...
> Hy, Postgresql community!
>
> I'm using:
> Linux RedHat6.2,
> PostgreSql6.5.3+jdbc6.5-1.2,
> jdk1.2.2
> (AND I CAN'T CHANGE THIS "KIT")
Tricky. It's fixed in 7.0. The only thing I can advise is to use the web
frontend of cvs, and see what changed between 6.5.2 and 7.0 in
org.postgresql.Connection (mainly the ExecSQL method) and the
org.postgresql.fastpath.* classes and put those changes in there.
Peter
>
> I've got the below java program and when I type:
> # javac PicImmitter.java , it's all ok.
> But my problem occours when I run:
> #java PicImmitter
> ..........and this is the error output:
>
> "FastPath protocol error: Z
> at postgresql.fastpath.Fastpath.fastpath(Fastpath.java:159)
> at postgresql.fastpath.Fastpath.fastpath(Fastpath.java:188)
> at postgresql.fastpath.Fastpath.getInteger(Fastpath.java:200)
> at
> postgresql.largeobject.LargeObjectManager.create(LargeObjectManager.java:162
> )
> at
> postgresql.jdbc2.PreparedStatement.setBytes(PreparedStatement.java:298)
> at ProvaPicIn.<init>(ProvaPicIn.java:48)
> at ProvaPicIn.main(ProvaPicIn.java:11) "
>
> What can I do, exactly? My Program is:
>
> import java.awt.*;
> import java.io.*;
> import java.io.FileInputStream;
> import java.sql.*;
> import postgresql.largeobject.*;
> import java.io.IOException;
>
> public class PicImmitter extends Frame{
> public static void main(String args[])
> {
> PicImmitter app = new PicImmitter();
> System.exit(0);
> }
>
> public PicImmitter()
> try{
> Class.forName("postgresql.Driver");
> Connection conn=DriverManager.getConnection("jdbc:postgresql:best",
> "Myuser","Mypwd");
> FileInputStream fis = new FileInputStream("015.jpg");
> int nBytes = fis.available();
> byte [] buff= new byte[nBytes];
> int bytesPhoto = fis.read(buff,0,nBytes);
> String photo = new String(buff);
>
> conn.setAutoCommit(false);
> PreparedStatement ps = conn.prepareStatement("update players set
> image = ? where playercode=?
> ");
> ps.setBytes(1,photo.getBytes());
> ps.setInt(2,15);
> ps.executeUpdate();
>
> fis.close();
> ps.close();
> conn.setAutoCommit(true);
> conn.close();
> }catch(Exception ex){
> ex.printStackTrace();
> }
> }
> }
>
> THANK'S A LOT
> MARCO FROM ITALY
>
>
>
>
>
>
>
>
>
>
>
--
Peter Mount peter@retep.org.uk
PostgreSQL JDBC Driver: http://www.retep.org.uk/postgres/
RetepPDF PDF library for Java: http://www.retep.org.uk/pdf/
^ permalink raw reply [nested|flat] 2+ messages in thread
end of thread, other threads:[~2001-02-13 10:02 UTC | newest]
Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2001-02-11 21:36 jdbc fastpath error & Z error (URGENT NEED!!!) Mark <bef5471@iperbole.bologna.it>
2001-02-13 10:02 ` Peter T Mount <peter@retep.org.uk>
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox