java - Insert big string (>4000) into Clob jdbc -


i'm stuck on this: i've followed hundreds procedures found on internet store big string clob object , oracle db. in particular: prepared statement (insert into) empty clob:

executer.add("s_nota_globale", clob.getemptyclob()); 

the line above populate the bind vars in query long. so, @ point, let's i've empty clob inserted (which true). then:

string sqltext = "select s_nota_globale " +                  "from   sn_denunce " +                  "where  id_denuncia = ? " +                  "for update";   preparedstatement psclobupdate= conn.preparestatement(sqltext); psclobupdate.setlong(1,denuncia.getid());   resultset  rset = psclobupdate.executequery(); rset.next(); clob  notaglobale = (clob) ((resultset) rset).getclob("s_nota_globale");   writer writer = notaglobale.setcharacterstream(0);  try {     writer.write(denuncia.getnotaglobale().tochararray());     writer.flush();     writer.close();     rset.close(); } catch (ioexception e) {     e.printstacktrace(); } 

another preparedstatement updating clob. problem once retrieve resultset, empty, reasonable(?), since i've inserted empty clob. don't know i'm getting wrog, surely i'm getting crazy.

the solution i've implemented taken following link (attempt #5): http://fahdshariff.blogspot.it/2008/07/big-strings-and-oracle-clobs.html

note: jdbc driver 11.2.0.4.0


Comments

Popular posts from this blog

Fail to load namespace Spring Security http://www.springframework.org/security/tags -

sql - MySQL query optimization using coalesce -

unity3d - Unity local avoidance in user created world -