From: | "M(dot) Dietrich" <mdt(at)emdete(dot)de> |
---|---|
To: | pgsql-jdbc(at)postgresql(dot)org |
Subject: | help: fastpath error! |
Date: | 2002-05-06 13:43:50 |
Message-ID: | 20020506134350.GE3762@emdete.de |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-jdbc |
hi everyone!
i get still those fastpath errors with the jdbc drivers. i tested the
driver installed with debian, the stable and the development driver
from jdbc.postgresql.org. has anybody else the same problem?
i use blobs alot. using blobs with pg-sql's jdbc does not work
strait-forward in a jdbc-manner like this:
statement.setBinaryStream(4, in, size);
even this does not work:
byte buffer[] = new byte[(int)size];
in.read(buffer);
statement.setBytes(4, buffer);
so this one is what i found out works best for me:
org.postgresql.largeobject.LargeObjectManager lom = ((org.postgresql.Connection)getConnection()).getLargeObjectAPI();
int loid = lom.create();
org.postgresql.largeobject.LargeObject blob = lom.open(loid);
int s;
byte buf[] = new byte[2048];
while ((s = in.read(buf, 0, buf.length)) > 0)
blob.write(buf, 0, s);
blob.close();
java.sql.Blob b = new org.postgresql.largeobject.PGblob((org.postgresql.Connection)getConnection(), loid);
statement.setBlob(4, b);
but using this i get the fast-path error. using the other versions
results in a errormessage containing all the binary data.
best regards,
michael
From | Date | Subject | |
---|---|---|---|
Next Message | Dave Cramer | 2002-05-06 14:03:15 | Re: JDBC Driver JAR Files |
Previous Message | Hoanui Morangie | 2002-05-06 10:03:38 | Re: Trouble with NULL |