---
title: "Warning: Superclass does not exist.错误解决方法"
author: "java_frog"
date: "2008-12-24T14:50:00Z"
tags: []
slug: "warning-superclass-does-not-exist"
draft: false
lastmod: "2008-12-24T14:50:00Z"
id: 300511
url: "https://java-frog.iteye.com/blog/300511"
---

1. 在Myeclipse 的stuts-config.xml里的design模式下点右键创建 Form，Action and JSP 的时候，出现：Warning: Superclass does not exist. 

答：把struts.jar在重新引入到工程目录下 

2. 创建数据库连接 

Connection conn = null;// 数据库连接 

Statement stmt = null;// 数据库表达式 

ResultSet rs = null;// 结果集 



try { 

Class.forName(driver); 

} catch (ClassNotFoundException e) { 

e.printStackTrace(); 

}// sql 的驱动 



try { 

conn = java.sql.DriverManager.getConnection(url,username,password); 

} catch (SQLException e) { 

e.printStackTrace(); 

} 

3. 数据操作 

stmt = conn.createStatement(); 

// 执行插入数据的 SQL 

int row = stmt.executeUpdate("insert into……"); 

rs = stmt.executeQuery("select * from Student"); 

while (rs.next()) { 

System.out.println("编号=" + rs.getInt(1)); 

System.out.println("学生姓名=" +rs.getString("username")); 

System.out.println("密码=" + rs.getString("password")); 

System.out.println("年龄=" + rs.getString("age")); 

} 

// 执行删除数据的 SQL, 被删除的记录的ID为7 

row = stmt.executeUpdate("delete from student where id = 7"); 

System.out.println("删除了 " + row); 

4. 关闭 

try { 

rs.close(); 

} 

catch (SQLException e){ 

} 

try { 

stmt.close(); 

} 

catch (SQLException e){ 

} 

try { 

conn.close(); 

} 

catch (SQLException e) { 

} 





5. Activation.main: 警告： sun.rmi.activation.execPolicy 系统属性未被指定且 ExecPermissions/ExecOptionPermissions均未被授权。随后的激活尝试失败，原因是对ExecPermission/ExecOptionPermission 的权限检查失败。 

有关如何配置 rmid 安全性的文档说明，请参阅： http://java.sun.com/j2se/1.4/docs/tooldocs/solaris/rmid.html 

http://java.sun.com/j2se/1.4/docs/tooldocs/win32/rmid.html 

原因：main函数未指定；运行时，可以选择该函数，右键运行