aspose file tools*
The moose likes Servlets and the fly likes What is the error?thanks! Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "What is the error?thanks!" Watch "What is the error?thanks!" New topic
Author

What is the error?thanks!

jsy
Greenhorn

Joined: Aug 14, 2001
Posts: 2
public String WriteClob(String text)throws Exception{
Class.forName ("oracle.jdbc.driver.OracleDriver");
Connection sqlcon=DriverManager.getConnection("jdbc racle ci8:@abcd","system","manager");
Statement sqlstmt=sqlcon.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE,ResultSet.CONCUR_UPDATABLE);
String strsql="select content from mytable where id=1000 for update";
ResultSet rs=sqlstmt.executeQuery(strsql);
if(rs.next()){
oracle.sql.CLOB clob=((oracle.jdbc.driver.OracleResultSet)rs).getCLOB("content");
Writer writer=clob.getCharacterOutputStream();
writer.write(text);
writer.flush();
writer.close();
}
sqlstmt.close();
sqlcon.close();
return "Success!";
}
first,it is sure that there is the record which id=1000.
The CLOB length is displayed when i add the statement "System.io.print(clob.length());" after the statement "clob=((oracle.jdbc.driver.OracleResultSet)rs).getCLOB("content");"
Who do help me ?
Rahul Mahindrakar
Ranch Hand

Joined: Jul 28, 2000
Posts: 1850

The Java Ranch has thousands of visitors every week, many with surprisingly similar names. To avoid confusion we have a naming convention, described at http://www.javaranch.com/name.jsp . We require names to have at least two words, separated by a space, and strongly recommend that you use your full real name. Please log in with a new name which meets the requirements.
Thanks.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: What is the error?thanks!