为什么用getString()不能完全取得数据库中的字符 可能微软实现getString()的这个方法最大的字符数是2000多吧。你可以用blob字段来解决 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 是的 必须用blob下面,我们将刚插入的记录从数据库中读取出来并显示之:<% String sql = "select content from test where doc_id=1"; ResultSet rs = stmt.executeQuery(sql); String content = ""; if (rs.next()) { oracle.sql.CLOB clob = (oracle.sql.CLOB)rs.getClob("content"); if (clob != null){ Reader is = clob.getCharacterStream(); BufferedReader br = new BufferedReader(is); String s = br.readLine(); while (s != null) { content += s + "<br>"; s = br.readLine(); } } out.println(content);%>这段代码你先试试 我是贴人家的……大家就是这样了以前有位虾写过一段 我调试成功过 try{Reader reader=rs.getCharacterStream("intro");BufferedReader bReader=new BufferedReader(reader);String inLine;strValue="";while((inLine=bReader.readLine())!= null){strValue=strValue+inLine;}}catch(Exception e){e.printStackTrace();}这样应该行的,你试试吧就是用Reader reader=rs.getCharacterStream("intro");代替String reader=rs.getString("intro"); lovelanzhi716(仰天长啸)说的不错,已经有一大进步了,可是还有一点我不明白的是,为什么有时能完全显示,有时仍然是只显示一部分.经过我多次的刷新,发现,这两种情况是间隔出现,一次完全显示,一次不完全显示.这是什么原因? jquery高手来帮下忙,在线等 熟悉lucene的朋友进来啊! 简单java问题! tomcat问题 关于js的一个小问题,高手帮个忙~~ 一个Jsp实现数据库插入数据的问题(源代码)(续) 求救!万分着急!谢谢先!!在线等!! tomcat菜鸟提问 我建立的环境怎么读不出我的JSP文件?还有怎样把中文转成UNICODE码,怎样得到那个值 Java上传文件编码格式 谁有WebGIS系统的开发经验啊? sql语法错误????
<%
String sql = "select content from test where doc_id=1";
ResultSet rs = stmt.executeQuery(sql);
String content = "";
if (rs.next()) {
oracle.sql.CLOB clob = (oracle.sql.CLOB)rs.getClob("content");
if (clob != null){
Reader is = clob.getCharacterStream();
BufferedReader br = new BufferedReader(is);
String s = br.readLine();
while (s != null) {
content += s + "<br>";
s = br.readLine();
}
}
out.println(content);
%>这段代码你先试试 我是贴人家的……大家就是这样了以前有位虾写过一段 我调试成功过
Reader reader=rs.getCharacterStream("intro");
BufferedReader bReader=new BufferedReader(reader);
String inLine;
strValue="";
while((inLine=bReader.readLine())!= null){
strValue=strValue+inLine;
}
}catch(Exception e){e.printStackTrace();}
这样应该行的,你试试吧就是用Reader reader=rs.getCharacterStream("intro");
代替String reader=rs.getString("intro");