就一个String就搞死我了``
做一个Telnet server`
现在的问题是从客户端过来的字符是8位的``
char是16位的``
只能从readByte来读`
byte b = din.readByte();
byte bs[] = new byte[40];
int i = 1;
while (b != 13){
bs[i]=b;
i+=2;
b =din.readByte();
}
String name = new String (bs,"UTF-16");
`可是``转出来的String好像不是这么回事``
用这个String来做SQL语句的条件不行`!!!`
当输入pioneer时
sql = "select * from table1 where name = '" + name + "'"``得到的结果就是空!!!
sql = "select * from table1 where name = 'pioneer'"```就能得到数据``
WHY!!!!!!!!!!!!!!!!!!!!!!