Statement stmt=con.createStatement();
ResultSet rst=stmt.executeQuery("select * from 测试表 ");
现在返回是空,怎么办呀?表名一般不能为汉字吧
谁这么牛啊...呵呵.
ResultSet rst=stmt.executeQuery("select * from 测试表 ");
现在返回是空,怎么办呀?表名一般不能为汉字吧
谁这么牛啊...呵呵.
建议更换表名。
若是测试用可以试一下。
String strSql = "select * from 测试表 ";
strSql = new String(strSql.getBytes("iso8859-1"),"gb2312");还可以试着设置数据接收的默认字符集为gb2312
在 ResultSet rst=stmt.executeQuery("select * from 测试表 ");之后加上rst.next();试试表名是可以用汉字的,不过最好别用汉字,麻烦!
在servlet中使用
String strSql= "selcet * from '测试表'";
strSql = new String(strSql.getBytes("GB2312"),"ISO8859_1");
不行呀,但是在 asp中使用却没有任何问题,难道jsp不如asp吗?
也不行