J
John_
Unregistered / Unconfirmed
GUEST, unregistred user!
我在用JSP同SQL SERVER进行连接时总是出现这样的情况:
------------------------------------------------------------------------------
500 Servlet Exception
java.lang.NullPointerException
at _jsp._class._Exam._Title__jsp._jspService(/class/Exam/Title.jsp:292)
at com.caucho.jsp.JavaPage.service(JavaPage.java:87)
at com.caucho.jsp.JavaPage.subservice(JavaPage.java:81)
at com.caucho.jsp.Page.service(Page.java:410)
at com.caucho.server.http.Invocation.service(Invocation.java:319)
at com.caucho.server.http.CacheInvocation.service(CacheInvocation.java:121)
at com.caucho.server.http.HttpRequest.handleRequest(HttpRequest.java:239)
at com.caucho.server.http.HttpRequest.handleConnection(HttpRequest.java:157)
at com.caucho.server.TcpConnection.run(TcpConnection.java:140)
at java.lang.Thread.run(Thread.java:566)
--------------------------------------------------------------------------------
Resin 1.2.10 (built Fri Jan 11 14:26:21 PST 2002)
------------------------------------------------------------------------------
我的代码是这样的:
public void jspInit()
{
try{
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver"
// Class.forName("com.microsoft.jdbc.sqlserver.SQLServerDriver".newInstance();
String url="jdbc:microsoft:sqlserver://liuxiang:1433;user=sa;password=888;DatabaseName=Leaders";
String user="sa";
String password="888";
con=DriverManager.getConnection(url,user,password);
stmt=con.createStatement(ResultSet.TYPE_SCROLL_SENSITIVE,ResultSet.CONCUR_UPDATABLE);
//stmt=con.createStatement(ResultSet.TYPE_SCROLL_SENSITIVE,ResultSet.CONCUR_UPDATABLE);
}
catch(Exception ex)
{
System.out.println(ex.toString());
}
}
不知是什么原因,以前在我的电脑上又可以,现在全部换一台机又不行了,
请帮我指正!
------------------------------------------------------------------------------
500 Servlet Exception
java.lang.NullPointerException
at _jsp._class._Exam._Title__jsp._jspService(/class/Exam/Title.jsp:292)
at com.caucho.jsp.JavaPage.service(JavaPage.java:87)
at com.caucho.jsp.JavaPage.subservice(JavaPage.java:81)
at com.caucho.jsp.Page.service(Page.java:410)
at com.caucho.server.http.Invocation.service(Invocation.java:319)
at com.caucho.server.http.CacheInvocation.service(CacheInvocation.java:121)
at com.caucho.server.http.HttpRequest.handleRequest(HttpRequest.java:239)
at com.caucho.server.http.HttpRequest.handleConnection(HttpRequest.java:157)
at com.caucho.server.TcpConnection.run(TcpConnection.java:140)
at java.lang.Thread.run(Thread.java:566)
--------------------------------------------------------------------------------
Resin 1.2.10 (built Fri Jan 11 14:26:21 PST 2002)
------------------------------------------------------------------------------
我的代码是这样的:
public void jspInit()
{
try{
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver"
// Class.forName("com.microsoft.jdbc.sqlserver.SQLServerDriver".newInstance();
String url="jdbc:microsoft:sqlserver://liuxiang:1433;user=sa;password=888;DatabaseName=Leaders";
String user="sa";
String password="888";
con=DriverManager.getConnection(url,user,password);
stmt=con.createStatement(ResultSet.TYPE_SCROLL_SENSITIVE,ResultSet.CONCUR_UPDATABLE);
//stmt=con.createStatement(ResultSet.TYPE_SCROLL_SENSITIVE,ResultSet.CONCUR_UPDATABLE);
}
catch(Exception ex)
{
System.out.println(ex.toString());
}
}
不知是什么原因,以前在我的电脑上又可以,现在全部换一台机又不行了,
请帮我指正!