jsp连接sql2000 对象名 'Class_Table' 无效 ..找不出原因..55
错误提示:
org.apache.jasper.JasperException: An exception occurred processing JSP page /save_class.jsp at line 15
12: <body>
13: <%
14: classBean.setClassInfo(class_Info);
15: classBean.classAdd();
16: %>
17: </body>
18: </html>
javax.servlet.ServletException:
java.sql.SQLException: [Microsoft][SQLServer 2000 Driver for JDBC][SQLServer]对象名 'Class_Table ' 无效。
以下是源码:
ConDatabase.java
package test;
import java.sql.*;
public class ConDatabase
{
public static Connection getConn()
{
String classForName = "com.microsoft.jdbc.sqlserver.SQLServerDriver ";
String servAndDB = "jdbc:microsoft:sqlserver://127.0.0.1:1433;DatabsaeName=jsp_test ";
String user = "sa ";
String passWord = "cn&2008 ";
Connection conn = null;
try
{
Class.forName(classForName);
conn =DriverManager.getConnection(servAndDB,user,passWord);
}
catch(Exception e)
{
e.printStackTrace();
}
return conn;
}
}
view_class.jsp
<%@ page language= "java " contentType= "text/html;charset=gb2312 " import= "java.sql.* " %>
<jsp:useBean id= "database " class= "test.ConDatabase " scope= "page "/>
<html xmlns= "http://www.w3.org/1999/xhtml ">
<head>
<meta http-equiv= "Content-Type " content= "text/html; charset=gb2312 " />
<