吴
吴剑明
Unregistered / Unconfirmed
GUEST, unregistred user!
访问了SQL SERVER数据库,做个查询就报错。我是IIS+JRUN3
JRUN报错,退出。
page info="database handler"
page import="java.io.*"
page import="java.util.*"
page import="java.sql.*"
page import="javax.servlet.*"
page import="javax.servlet.http.*"
String url = "jdbcdbc:Mis";
try
{
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
Connection connection = DriverManager.getConnection(url,"misadmin","admin");
String sql = "select * from a";
Statement statement = connection.createStatement();
ResultSet rs = statement.executeQuery(sql);
rs.next();
String a = rs.getString(1);
out.print("<B>this is a jsp db " + a+"<B>");
}
catch(Exception ex)
{
out.print(ex);
};
为何啊
JRUN报错,退出。
page info="database handler"
page import="java.io.*"
page import="java.util.*"
page import="java.sql.*"
page import="javax.servlet.*"
page import="javax.servlet.http.*"
String url = "jdbcdbc:Mis";
try
{
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
Connection connection = DriverManager.getConnection(url,"misadmin","admin");
String sql = "select * from a";
Statement statement = connection.createStatement();
ResultSet rs = statement.executeQuery(sql);
rs.next();
String a = rs.getString(1);
out.print("<B>this is a jsp db " + a+"<B>");
}
catch(Exception ex)
{
out.print(ex);
};
为何啊