Problem when CLOB columns are longer (e.g. 10000 chars)
0 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Gregor_Graf
Posted On:   Monday, April 29, 2002 04:48 AM

Hello everyone! I have a very serious problem: For replicating our Oracle database we use servlets that read LOBs from one database and write them into another one (using 2 separate database connections). This works without any problems, but today I noticed, that there are problems when CLOBs are "too long". In fact, they are not that long! The record that made the problems counted only (approcimately) 10000 characters!!! Apart from establishing connection and all that stuff, the following code is the most interesting part of the program: -------------------------------------------------- //creating statement PreparedStatement pstmt = con9i.prepareStatement("update publi   More>>

Hello everyone!





I have a very serious problem: For replicating our Oracle database we use servlets that read LOBs from one database and write them into another one (using 2 separate database connections).



This works without any problems, but today I noticed, that there are problems when CLOBs are "too long". In fact, they are not that long! The record that made the problems counted only (approcimately) 10000 characters!!!




Apart from establishing connection and all that stuff, the following code is the most interesting part of the program:

--------------------------------------------------
//creating statement

PreparedStatement pstmt = con9i.prepareStatement("update publication_data set text=? where id="+id);

//setting characterStream, since setClob fails with "Table or View does not exist"

pstmt.setCharacterStream(1,lobo.getCharacterStream(),(int)lobo.length());

processed=pstmt.executeUpdate (); // Do the update

System.out.println("CLOB (ID: "+id+"): Update executed for "+processed+" Rows");

---------------------------------------------------



Any help would be greatyl appreciated!!!

Kind regards,
Gregor Graf    <<Less
About | Sitemap | Contact