JDBC 2.0, updating TEXT fields
Posted in 1999
Topics: Connectivity: ODBC / JDBC / .NET, Java & JDBC Development
Hi, I am looking for the appropriate way to insert/update TEXT fields via the JDBC driver. The JDBC driver won't accept updates as String, Blob, or Clob. getBlob(), or getClob() on a Resultset object fails equally. Thanks in advance, Jos Snellings One For You Belgium nv
$B$3$N5-;v$O(B autoFollow(960226)$B$K$h$k<+F0Ej9F$G$9!#2<5-$KH=Dj7k2L$r<($7$^$9!#(B o From: $B$N%"%I%l%9$N%I%a%$%sL>(B ....... $BB?J,(B $B!{(B o Message-ID: $B$N(BID$BJ8;zNs(B ............. $BB?J,(B $B!{(B o Date: $B$N%?%$%`%>!<%s(B ............... $BB?J,(B $B!{(B o Newsgroups: $B$N%/%m%9%]%9%H(B ......... $BB?J,(B $B!{(B o $B%X%C%@$N4A;z%3!<%I(B ................. $BB?J,(B $B!{(B o $BK\\J8$N4A;z%3!<%I(B.................... $BB?J,(B $B!{(B In article <36C292BA.CDEBF868@lin.vlaanderen.be> Jos.Snellings@lin.vlaanderen.be writes: |Path: u-ryukyu.ac.jp!ie.u-ryukyu.ac.jp!hakata!news-sv.sinet!news.join.ad.jp!newsfeed.mathworks.com!EU.net!news0.Belgium.EU.net!newsr.Belgium.EU.net!not-for-mail |From: Jos Snellings <Jos.Snellings@lin.vlaanderen.be> |Newsgroups: comp.databases.informix |Subject: JDBC 2.0, updating TEXT fields |Date: Thu, 11 Feb 1999 09:20:10 +0100 |Organization: EUnet Belgium, Leuven, Belgium |Lines: 11 |Message-ID: <36C292BA.CDEBF868@lin.vlaanderen.be> |NNTP-Posting-Host: 193.121.174.97 |Mime-Version: 1.0 |Content-Type: text/plain; charset=us-ascii |Content-Transfer-Encoding: 7bit |X-Mailer: Mozilla 4.05 [nl] (WinNT; I) |Xref: u-ryukyu.ac.jp comp.databases.informix:65243 | |Hi, | |I am looking for the appropriate way to insert/update TEXT fields |via the JDBC driver. |The JDBC driver won't accept updates as String, Blob, or Clob. |getBlob(), or getClob() on a Resultset object fails equally. | |Thanks in advance, |Jos Snellings |One For You Belgium nv |
Jos Snellings wrote:
> I am looking for the appropriate way to insert/update TEXT fields
> via the JDBC driver.
> The JDBC driver won't accept updates as String, Blob, or Clob.
> getBlob(), or getClob() on a Resultset object fails equally.
Apart from the reply from the other poster re setAsciiStream etc, I've
had problems updating TEXT fields in Informix.
Informix only gives a certain number of ways to insert into a text
column:
dbload, tbload
SQL command LOAD
Screen form with Program attributes
TEXT host variables
embedded SQL
HTH
Allan Gould
SCO CID Support, Leeds, UK
(allang at sco dot com)
(Please remove anti-spam measures if replying)
On Fri, 12 Feb 1999 08:37:51 +0000, Allan Gould <allang@sco.remove_me.com> wrote: >Jos Snellings wrote: >> I am looking for the appropriate way to insert/update TEXT fields >> via the JDBC driver. >> The JDBC driver won't accept updates as String, Blob, or Clob. >> getBlob(), or getClob() on a Resultset object fails equally. >Apart from the reply from the other poster re setAsciiStream etc, I've >had problems updating TEXT fields in Informix. The older driver (1.20 I believe had problems with it), we are currently running 1.22X1 and having no trouble. We haven't tried 1.40 yet. The following java snippit is we use to update TEXT fields byte[] isochars=null; ByteArrayInputStream stream; PreparedStatement statement; Connection conn; isochars=bigstr.getBytes("ISO-8859-1"); stream=new ByteArrayInputStream(isochars); conn=JDBCutil.getConnection(); statement= conn.prepareStatement("insert into documents values(?,?,?,1)"); statement.setInt(1,key); statement.setString(2,titel); statement.setAsciiStream(3,stream,isochars.length); statement.executeUpdate(); statement.close(); conn.close(); Where field 3 is a TEXT field. -- Rico Jansen (rico@vpro.nl) http://james.vpro.nl/ James a Webserver in Java. "You call it untidy, I call it LRU ordered" -- Daniel Barlow