L
lql0459
Unregistered / Unconfirmed
GUEST, unregistred user!
以下是一个连接数据库并显示查询结果的源程序:
问题:不能在IE(我使用UltraDev4.01)中查询到应有的结果!请各位帮忙!
说明:我已建好了数据库introduce.mdb(内有三条记录),并设置了system dsn为
siteconn(指向数据库introduce.mdb)
<%@ page contentType="text/html;charset=gb2312"%>
<%@ page import="java.sql.*" %>
<%@ include file="d:/xtong/public/conn.jsp" %>
<%
RS=stmt.executeQuery("SELECT * FROM introduce");
String introduce;
out.print("<table border='2' style='color:white'>");
while (RS.next()){
out.print("<tr><td>"):
introduce=RS.getString("introduce");
out.print(introduce);
out.print("</tr></td>");
}
out.print("</table>");
RS.close();
%>
以下是conn.jsp(加载驱动源码)的源程序:
<%
String DBDriver = "sun.jdbc.odbc.JdbcOdbcDriver";
String ConnStr = "jdbcdbc:siteconn";
Connection conn = null;
Statement stmt=null;
ResultSet rs = null;
try
{
Class.forName(DBDriver);
//加载数据库驱动程序
}
catch(java.lang.ClassNotFoundException e)
{
System.err.println("加载数据库驱动时出错: " + e.getMessage());
}
try
{
conn=DriverManager.getConnection(ConnStr,"","");
}
catch(SQLException e)
{
outprint("连接数据库时出错:"+e.toString());
}
%>
》》》》》》请回答问题的朋友看一下已回答的内容,以防有新问题出现!谢谢您的回答!
问题:不能在IE(我使用UltraDev4.01)中查询到应有的结果!请各位帮忙!
说明:我已建好了数据库introduce.mdb(内有三条记录),并设置了system dsn为
siteconn(指向数据库introduce.mdb)
<%@ page contentType="text/html;charset=gb2312"%>
<%@ page import="java.sql.*" %>
<%@ include file="d:/xtong/public/conn.jsp" %>
<%
RS=stmt.executeQuery("SELECT * FROM introduce");
String introduce;
out.print("<table border='2' style='color:white'>");
while (RS.next()){
out.print("<tr><td>"):
introduce=RS.getString("introduce");
out.print(introduce);
out.print("</tr></td>");
}
out.print("</table>");
RS.close();
%>
以下是conn.jsp(加载驱动源码)的源程序:
<%
String DBDriver = "sun.jdbc.odbc.JdbcOdbcDriver";
String ConnStr = "jdbcdbc:siteconn";
Connection conn = null;
Statement stmt=null;
ResultSet rs = null;
try
{
Class.forName(DBDriver);
//加载数据库驱动程序
}
catch(java.lang.ClassNotFoundException e)
{
System.err.println("加载数据库驱动时出错: " + e.getMessage());
}
try
{
conn=DriverManager.getConnection(ConnStr,"","");
}
catch(SQLException e)
{
outprint("连接数据库时出错:"+e.toString());
}
%>
》》》》》》请回答问题的朋友看一下已回答的内容,以防有新问题出现!谢谢您的回答!