<!--
说明:数据库为oracle9i(字符集为英文),
jb2006中测试没有问题(通过字符转换后),jsp中无论如何做字符集转换也是乱码,请问这是什么原因。
-->
<%@ page contentType="text/html charset=gb2312" language="java" errorPage="" %>
<%@ page import="system.*" %>
<%@ page import="java.*" %>
<%@ page import="java.util.*" %>
<%@ page import="javax.sql.*" %>
<%@ page import="java.sql.*" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>无标题文档</title>
<style type="text/css">
<!--
.STYLE1 {color: #FF8040}
-->
</style>
</head>
<body>
<%
System_CfgFile cfgfile=new System_CfgFile();
System_DBConnBase dbconn=new System_DBConnBase();
System_SystemBase systembase = new System_SystemBase();
%>
<p class="STYLE1">数据库参数读取成功!</p>
<%
if (dbconn.dbConnection())
{%>
<p class="STYLE1">数据库直连成功!</p>
<%
}
if (!dbconn.dbConnection())
{
%>
<p class="STYLE1">数据库连接池连接成功!</p>
<p>
<%
}
String sqla=" select * from bm_bbdl";
ResultSet rs = dbconn.Execute_Query(sqla);
%>
<form id="form1" name="form1" method="post" action="">
<table border="2" bordercolor="#000033">
<tr>
<% int i = 0;
while (rs.next()) {
for (int column = 1; column < 3; column++) {
i++;
%>
<td> <%=("1:"+rs.getString(column))%> </td>
<td> <%=("2:"+rs.getString(column).getBytes())%> </td>
<td> <%=("3:"+rs.getString(column).getBytes("GB2312"))%> </td>
<td> <%=("4:"+rs.getString(column).getBytes("ISO8859_1"))%> </td>
<td> <%=("5:"+new String(rs.getString(column).getBytes()))%> </td>
<td> <%=("6:"+new String(rs.getString(column).getBytes(),"GB2312"))%> </td>
<td> <%=("7:"+new String(rs.getString(column).getBytes(),"ISO8859_1"))%> </td>
<td> <%=("8:"+new String(rs.getString(column).getBytes("GB2312")))%> </td>
<td> <%=("9:"+new String(rs.getString(column).getBytes("GB2312"),"GB2312"))%> </td>
<td> <%=("10:"+new String(rs.getString(column).getBytes("GB2312"),"ISO8859_1"))%> </td>
<td> <%=("11:"+new String(rs.getString(column).getBytes("ISO8859_1")))%> </td>
<td> <%=("12:"+new String(rs.getString(column).getBytes("ISO8859_1"),"GB2312"))%> </td>
<td> <%=("13:"+new String(rs.getString(column).getBytes("ISO8859_1"),"ISO8859_1"))%> </td>
<td> <%=("14:"+new String(rs.getString(column).getBytes("ISO8859_1"),"UTF8"))%> </td>
</tr>
<% }
}
%>
</table>
</form>
</body>
</html>
请高手指教,我已无招了。谢谢!