Warning: Superclass does not exist.错误解决方法

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函数未指定;运行时,可以选择该函数,右键运行
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值