• Mysql,SQL Server 2000,Oracle四种数据库的连接

    <%! String trans(String chi) { String result = null; byte temp []; try { temp=chi.getBytes("iso-8859-1"); result = new String(temp); } catch(UnsupportedEncodingException e) { System.out.println (e.toString()); } return result; } %> <% Class.forName("com.microsoft.jdbc.sqlserver.SQLServerDriver").newInstance(); Connection con=java.sql.DriverManager.getConnection("jdbc:microsoft:sqlserver://localhost:1433;DatabaseName=books","sa",""); Statement stmt=con.createStatement(); ResultSet rst=stmt.executeQuery("select * from book"); while(rst.next()) { out.println("<tr>"); out.println("<td>"+rst.getString("bookId")+"</td>"); out.println("<td>"+trans(rst.getString("bookName"))+"</td>"); out.println("<td>"+trans(rst.getString("publisher"))+"</td>"); out.println("<td>"+rst.getFloat("price")+"</td>"); out.println("</tr>"); } //关闭连接、释放资源 rst.close(); stmt.close(); con.close(); %> </table> </body> </html>

    0
    70
    1.63MB
    2008-12-10
    9
  • http-equiv 用法大全 .doc

    该META标签定义了HTML页面所使用的字符集为GB2132,就是国标汉字码。如果将其中的“charset=GB2312”替换成“BIG5”,则该页面所用的字符集就是繁体中文Big5码。当你浏览一些国外的站点时,IE浏览器会提示你要正确显示该页面需要下载xx语支持。这个功能就是通过读取HTML页面META标签的Content-Type属性而得知需要使用哪种字符集显示该页面的。如果系统里没有装相应的字符集,则IE就提示下载。其他的语言也对应不同的charset,比如日文的字符集是“iso-2022-jp ”,韩文的是“ks_c_5601”。

    0
    313
    35KB
    2008-12-10
    10
  • Java 中文乱码的处理

    随着计算机的发展,为了适应世界其它民族的语言(当然包括我们的汉字),人们提出了UNICODE编码,它采用双字节编码,兼容英文字符和其它民族的双字节字符编码,所以,目前,大多数国际性的软件内部均采用UNICODE编码,在软件运行时,它获得本地支持系统(多数时间是操作系统)默认支持的编码格式,然后再将软件内部的UNICODE转化为本地系统默认支持的格式显示出来。

    5
    88
    55KB
    2008-12-10
    15
关注 私信
上传资源赚积分or赚钱