• Post Reply Bookmark Topic Watch Topic
  • New Topic

Oracle clob?  RSS feed

 
Martin Hansson
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi I have a problem retriving a clob in my jsp file.
I get an error message telling me...
Explicit cast needed to convert java.sql.Clob to oracle.sql.CLOB.
Do any one now how to solve the problem?
The code looks like this (its a include file so the db connection is not there):
<%
String reqPageID = "";
reqPageID = request.getParameter("pageid");
String contentText = "no values";
String contentTopic = "No Topic";

out.println(reqPageID);
if (reqPageID != null)
{
// Get all company locations out of the database.
query = "";
query = query + " SELECT *";
query = query + " FROM viewpageandelementsactive";
ResultSet rsPage = stmt.executeQuery(query);

// Check the recordset for data.
if (rsPage == null)
{
contentText = "No database connection";
// If there is a result generate the dropdown with the result.
} else if (rsPage.next())
{
//clob = ((OracleResultSet)rsPage).getClob("sElementValue");
clob = rsPage.getClob("sElementValue");
//String st = rs.getString(2);
//if (clob != null) {
//out.println ("clob length = "+clob.length ());
//}
//contentText = rsPage.getString("sElementValue");
//contentTopic = CheckAndTrim(rsPage.getString("sPageTitle"));
}
rsPage.close();
} else {
contentText = "Null value";
}
%>
 
Syam Veerakumar
Ranch Hand
Posts: 49
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am not sure about this anyway try the following and correct me if i am wrong.
clob = (clob)rsPage.getClob("sElementValue");
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!