讀取顯示CLOB的值,不能讀取啊,請高手指點11!

xqjyy發表於2004-08-26
程式碼如下:
try{
rs=null;
java.sql.Clob myClob = null;
Statement stmt2 = conn.createStatement();
strSQL=null;
strSQL="SELECT content from news_content where num="+request.getParameter("num");
stmt2.execute(strSQL);
rs = stmt2.getResultSet();
while (rs.next())
{
myClob = rs.getClob("content");
strContent=myClob.getSubString((long)1,(int)myClob.length());

}
}catch (Exception e){
e.printStackTrace() ;
}finally{
if(rs!=null){
rs.close();
}
}
%>

相關文章