Configuring Tomcat4.1.1 JSDK1.4.0Tomcat provided by JSP JavaBean examples can be implemented
I wrote a very simple Conn class that connects the database, providing the execution method querying the database, and uses the Test class written in the DOS environment to query the data of the database.
Here is the JSP file I wrote: <% @ Page ContentType = "text / html; charset = GB2312" Language = "java" IMPORT = "java.sql. *"%> <% @ Page import = "conn.conn" %>
String query = "SELECT NAME, Password from jialEuser where name = 'aaa'"; resultset = null; try {= check.executeQuery (query); if (rs.next ()) {Out.println (rs.getstring ("name"); out.println (rs.getstring ("password"));} rs.close ();} catch (sqlexception sqle) {outputln (SQLE);}%> body> < / html>
After execution of IE6.0, an error is reported to HTTP STATUS 500-
TYPE EXCEPTION Report
Message
Description The Server Encounteredna Internal Error () That Prevented It from fulilling this request.
Exception org.apache.jasper.jaspeexception (a lot of unknown files)
Root causejava.lang.nullpointersRexception (a lot of unknown files)
I judge that it is the error in Tomcat, but I don't know how to solve it, I hope to give me :)