Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Can u provide connection for OCI drivers to insert morethan 4kb data in CLOB Object

 
anilellendula kumar
Ranch Hand
Posts: 43
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i need to connect to databse through the OCI Drivers ,My Database is Oracle 9i, so i have done below code




try
{
Class.forName("oracle.jdbc.driver.OracleDriver");
//oracle.jdbc.pool.OracleConnectionPoolDataSource");
Connection conn=DriverManager.getConnection("jdbcracleci:@framid04.de.eu.colt:1522:WMTEST","projdef","projdef");
String sql="insert into CLOB_TEST(ID,DOCUMENT,XML_DOCUMENT) values (?,?,?)";
PreparedStatement pst=conn.prepareStatement(sql);

//pst.setLong(1, id);
pst.setInt(1,ordernum);
pst.setString(2,orderitm);
pst.setCharacterStream(3, reader1, data.length());

pst.executeUpdate();

if i am trying to run code with sample data Giving Exception

java.lang.reflect.InvocationTargetException:envCharSetId,pls check oracle.jdbc.driver.OracleDriver Driver supports OCI Driver if not supports can provide me the logic to insert CLOB Data.

in the above code if remove oci keep thin it is inserting below 4 kb data in CLOB OBJECT of DB Table.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic