Z
zxf_1
Unregistered / Unconfirmed
GUEST, unregistred user!
/**查询CLOB类型值*/
public String QueryCLOB(String table, String wherestr, String clobfield)
{
String out = "";
try
{
String sqlCommand = "select "
+ clobfield + "
from "
+ table;
if(!wherestr.equals("")
{
sqlCommand += "
where "
+ wherestr;
}
pstm = conn.prepareStatement(sqlCommand);
rs = pstm.executeQuery();
if(rs.next())
{
oracle.sql.CLOB clob = (oracle.sql.CLOB)rs.getClob(clobfield);
if(clob != null)
{
Reader is = clob.getCharacterStream();
BufferedReader br = new BufferedReader(is);
String s = br.readLine();
while(s != null)
{
out += s;
s = br.readLine();
}
}
}
rs.close();
pstm.close();
//out = (new DealString()).Replace(out,"/"","/"/""
}
catch(SQLException sqle)
{
System.out.println("调用MyDataBase.QueryCLOB()函数错误:/r/n"
+ sqle);
}
catch(IOException iosql)
{
System.out.println("调用MyDataBase.QueryCLOB()函数错误:/r/n"
+ iosql);
}
return out;
}
这是报错结果
张小峰工作QQ(267456602) (2006-01-24 11:12:16)
Note: sun.tools.javac.Main has been deprecated.
E:/jsp/WEB-INF/classes/com/ideas/bean/DataBase.java:712: Class oracle.sql.CLOB
not found.
这段如何改成MYSQL的!
public String QueryCLOB(String table, String wherestr, String clobfield)
{
String out = "";
try
{
String sqlCommand = "select "
+ clobfield + "
from "
+ table;
if(!wherestr.equals("")
{
sqlCommand += "
where "
+ wherestr;
}
pstm = conn.prepareStatement(sqlCommand);
rs = pstm.executeQuery();
if(rs.next())
{
oracle.sql.CLOB clob = (oracle.sql.CLOB)rs.getClob(clobfield);
if(clob != null)
{
Reader is = clob.getCharacterStream();
BufferedReader br = new BufferedReader(is);
String s = br.readLine();
while(s != null)
{
out += s;
s = br.readLine();
}
}
}
rs.close();
pstm.close();
//out = (new DealString()).Replace(out,"/"","/"/""
}
catch(SQLException sqle)
{
System.out.println("调用MyDataBase.QueryCLOB()函数错误:/r/n"
+ sqle);
}
catch(IOException iosql)
{
System.out.println("调用MyDataBase.QueryCLOB()函数错误:/r/n"
+ iosql);
}
return out;
}
这是报错结果
张小峰工作QQ(267456602) (2006-01-24 11:12:16)
Note: sun.tools.javac.Main has been deprecated.
E:/jsp/WEB-INF/classes/com/ideas/bean/DataBase.java:712: Class oracle.sql.CLOB
not found.
这段如何改成MYSQL的!