RE: JDBC driver writes binary data ONLY as Large Obj ect
От | Peter Mount |
---|---|
Тема | RE: JDBC driver writes binary data ONLY as Large Obj ect |
Дата | |
Msg-id | 1B3D5E532D18D311861A00600865478CF1B1B5@exchange1.nt.maidstone.gov.uk обсуждение исходный текст |
Список | pgsql-interfaces |
Hmmm, I see your point. There must be some way of encoding the string so that the data is stored correctly. I know certain control characters can be stored (cr/lf's etc) as I have a PHP script that does it here. Is it the new String(bytes[]) bit that barfs, or is it that the data is mungled when it's re-read from the table? Peter -- Peter Mount Enterprise Support Maidstone Borough Council Any views stated are my own, and not those of Maidstone Borough Council -----Original Message----- From: Bill [mailto:bouma@cplane.com] Sent: Wednesday, August 02, 2000 8:57 PM To: Peter Mount Cc: pgsql-interfaces@postgresql.org Subject: Re: [INTERFACES] JDBC driver writes binary data ONLY as Large Object Peter Mount wrote: > The problem here is that there is no metadata available to check. > > If the backend was able to precompile the query, then we would know the > column type, but as it stands currently there is no way of finding out what > the column type is. > > Peter Ok. Suppose there was metadata available. How would you rewrite the function PreparedStatement.writeBytes() such that it writes the bytes directly into the column? Since that class does everything through heavy use of String manipulation, I can't see how to do it. Is there a way? I tried this: public void setBytes(int parameterIndex, byte x[]) throws SQLException { set(parameterIndex, new String(x)); } It barfed. Bill
В списке pgsql-interfaces по дате отправления: