如题:
最近写了一个小的程序,有这样一段: public void setDirectory(String s){
String s1 = null;
try{
s1= new String(s.getBytes("ISO-8859-1"),"gbk");
}catch(Exception e){;}
this.directory = s1;
}public boolean insert(){
ins = new insert();
ins.setTableName("teachplan");
ins.setInsertContent("`Directory`='"+this.directory);
boolean r = ins.insert();
ins.close();
return r;
}用过很长时间没有问题,但是当我存入以下数据的时候,出错了:<html>
<head>
<meta http-equiv=Content-Type content="text/html; charset=GB2312">
<link rel=Edit-Time-Data href="./第07课时Word的基本概念及文字的修饰.files/editdata.mso">
<link rel=OLE-Object-Data href="./第07课时Word的基本概念及文字的修饰.files/oledata.mso">
<title>Word的基本概念及文字的修饰</title>
<style>
<!--
.MsoBodyTextIndent
{text-align:justify;
text-justify:inter-ideograph;
text-indent:24.0pt;
font-size:12.0pt;
font-family:"Times New Roman";}
.Section1
{page:Section1;}
-->
</style>
</head>
<body bgcolor="#FFFFFF" class="Normal" lang=ZH-CN> 
<div class=Section1 style='layout-grid:15.6pt'> 更令我费解的是,将最后一行改为以下就又没有事了:
<div class=Section1 style=1234564654645646>有知道为什么的吗?mysql中的字段类型为text型。