File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
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 | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » JDBC
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
jdbc driver
How to store & retrieve a video file from database?
best programming practises of JDBC
an example to insert data into Oracle Clob