When processing the clob character field, if the string is directly passed to oracleparameter, an exception occurs when the string length exceeds 4000:
ORA-01460: conversion requests cannot be implemented or unreasonable
Because the maximum length of Oracle characters is 4000, You need to construct an oracleclob object and write the string to be passed into oracleclob. The following code is used:
Command. commandtext = "select * from table (analysebuffer (: GML)"; <br/> oracleclob clob = new oracleclob (command. connection, true, false); <br/> // gmlpolygon is a string longer than 4000 characters. <br/> char [] cs = gmlpolygon. tochararray (); <br/> clob. write (CS, 0, CS. length); <br/> oracleparameter para = new oracleparameter ("GML", oracledbtype. clob, clob, parameterdirection. input); <br/> command. parameters. insert (0, para); <br/> dataset DS = new dataset (); <br/> oracledataadapter ad = new oracledataadapter (command); <br/> ad. fill (DS );