Warning:Superclassdoesnotexist.错误解决方法
1.当你在Myeclipse的stuts-config.xml中右键点击设计模式创建表单、动作和JSP时,会出现以下信息:警告:超类不存在。
答:将struts.jar重新引入项目目录
2。创建数据库连接
Connection conn = null;//数据库连接
语句stmt = null//数据库表达式
ResultSet RS = null;//结果集
try {
class . for name(driver);
} catch(ClassNotFoundException e){
e . printstacktrace();
}//SQL
的驱动程序try {
conn = Java . SQL . driver manager . getconnection(URL,用户名,密码);
} catch(SQLException e){
e . printstacktrace();
}
3。数据操作
stmt = conn . create statement();
//执行SQL插入数据
int row = stmt . Execute update(" insert into…");
RS = stmt . execute query(" select * from Student ");
while(RS . next()){
system . out . println(" number = "+RS . getint(1));
system . out . println(" student name = "+RS . getstring("用户名"));
system . out . println(" password = "+RS . getstring(" password "));
system . out . println(" age = "+RS . getstring(" age "));
}
/执行SQL删除数据,删除记录的ID为7
row = stmt . Execute update(" delete from student where ID = 7 ");
system . out . println(" deleted "+row);
4。close
try {
RS . close();
}
catch(SQLException e){
}
try {
stmt . close();
}
catch(SQLException e){
}
try {
conn . close();
}
catch(sqlexception){
}
5 . activation . main:警告:未指定sun.rmi.activation.execPolicy系统属性,也未授权exec permissions/exec permissions。big测试提示的后续激活尝试失败,因为exec permission/execution permission的权限检查失败。
参见:http://Java . sun . com/J2SE/1.4/docs/tool docs/Solaris/rmid . html
http://java.sun.com/J2SE/1.4/docs/.运行时,可以选择该函数,点击右键运行。
0条评论