N
nankym
Unregistered / Unconfirmed
GUEST, unregistred user!
sqlConn = linkDatabase.createLink();这句是我自己编写的yyh类连接数据库用的;执行下面的程序无提示错误,页面是空白的,我想程序应该是没有执行try以下的代码,但我也想不到原因在哪,请大家帮我看看错误在哪?
<%@ page import="java.net.*,javax.naming.*,yyh.*,java.io.*,java.util.*,java.sql.*" contentType="text/html;
charset=gb2312" %>
<%
java.sql.Connection sqlConn;
java.sql.Statement sqlStmt;
java.sql.ResultSet sqlRst;
String sqlStr;
%><html><%
try
{
sqlConn = linkDatabase.createLink();
if(sqlConn!=null)
{
sqlStmt = sqlConn.createStatement();
sqlStr = "select dlyid,xm,dlsj from dllog";
sqlStmt.execute(sqlStr);
sqlRst = sqlStmt.getResultSet();
%>
<head>
<title>无标题文档</title>
<meta http-equiv="Content-Type" content="text/html;
charset=gb2312">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<table width="563" border="1" cellpadding="0" cellspacing="0" align= "center">
<tr>
<th width="150">ID</th>
<th width="117">姓名</th>
<th width="224">时间</th>
</tr>
<% while(sqlRst.next()) {%>
<tr>
<td><%=sqlRst.getString("dlyid") %></td>
<td><%=sqlRst.getString("xm") %></td>
<td><%=sqlRst.getString("dlsj") %></td>
</tr>
<%}%>
</table>
</body>
</html>
<%
sqlRst.close();
sqlStmt.close();
sqlConn.close();
}}
catch (Exception e)
{
//out.print("Exception: " + e+sqlStr);
}
%>
<%@ page import="java.net.*,javax.naming.*,yyh.*,java.io.*,java.util.*,java.sql.*" contentType="text/html;
charset=gb2312" %>
<%
java.sql.Connection sqlConn;
java.sql.Statement sqlStmt;
java.sql.ResultSet sqlRst;
String sqlStr;
%><html><%
try
{
sqlConn = linkDatabase.createLink();
if(sqlConn!=null)
{
sqlStmt = sqlConn.createStatement();
sqlStr = "select dlyid,xm,dlsj from dllog";
sqlStmt.execute(sqlStr);
sqlRst = sqlStmt.getResultSet();
%>
<head>
<title>无标题文档</title>
<meta http-equiv="Content-Type" content="text/html;
charset=gb2312">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<table width="563" border="1" cellpadding="0" cellspacing="0" align= "center">
<tr>
<th width="150">ID</th>
<th width="117">姓名</th>
<th width="224">时间</th>
</tr>
<% while(sqlRst.next()) {%>
<tr>
<td><%=sqlRst.getString("dlyid") %></td>
<td><%=sqlRst.getString("xm") %></td>
<td><%=sqlRst.getString("dlsj") %></td>
</tr>
<%}%>
</table>
</body>
</html>
<%
sqlRst.close();
sqlStmt.close();
sqlConn.close();
}}
catch (Exception e)
{
//out.print("Exception: " + e+sqlStr);
}
%>