`
java_frog
  • 浏览: 245527 次
  • 性别: Icon_minigender_1
  • 来自: 北京
社区版块
存档分类
最新评论

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函数未指定;运行时,可以选择该函数,右键运行 
分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics