This week's book giveaway is in the Agile and other Processes forum.
We're giving away four copies of The Mikado Method and have Ola Ellnestam and Daniel Brolund on-line!
See this thread for details.
The moose likes JDBC and the fly likes Can u provide connection for OCI drivers to insert morethan 4kb data in CLOB Object Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Databases » JDBC
Reply Bookmark "Can u provide connection for OCI drivers to insert morethan 4kb data in CLOB Object " Watch "Can u provide connection for OCI drivers to insert morethan 4kb data in CLOB Object " New topic
Author

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

anilellendula kumar
Ranch Hand

Joined: Jul 12, 2005
Posts: 43
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.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Can u provide connection for OCI drivers to insert morethan 4kb data in CLOB Object
 
Similar Threads
Blob Clob
best programming practises of JDBC
How to store & retrieve a video file from database?
jdbc driver
an example to insert data into Oracle Clob