954,574 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

error due to accessing database connection using jsp

<%@ page language="Java" import="java.sql.*" %>

Results from




<%
db.connect();


ResultSet rs = db.execSQL("select * from employ");
int i = db.updateSQL("UPDATE employ set fname = 'hello world' where empno='000010'");
out.println(i);

%>

<%
while(rs.next()) {
%>
<%= rs.getString("empno") %>


<%
}
%>


<%

db.close();

%>

Done

muthumari
Newbie Poster
20 posts since Mar 2006
Reputation Points: 10
Solved Threads: 0
 
org.apache.jasper.JasperException: Unable to compile class for JSPNote: sun.tools.javac.Main has been deprecated. error: Invalid class file format in C:\Program Files\Apache Tomcat 4.0\webapps\muthu\WEB-INF\classes\SQLBean\DbBean.class. The major.minor version '49.0' is too recent for this tool to understand.

The error message is clear enough. You are compiling the class(es) with a higher version of JDK than what Tomcat 4.0 is supposed to use. From the major.minor version = 49.0, I guess you are using JDK 1.4. If you want to generate classes compatible with the older versions [JDK 1.3 in your case], you will have to make use of the-source and -target options while compiling your class. The source option specified as "1.3" will indicate that the source files are compatible to JDK 1.3 and the target option set to "1.3" indicates that the generated classes will be compatible from JDK 1.3 onwards.

aniseed
Posting Whiz
359 posts since Apr 2006
Reputation Points: 48
Solved Threads: 7
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You