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函数未指定;运行时,可以选择该函数,右键运行
分享到:
相关推荐
Puzzle 90: It's Absurd, It's a Pain, It's Superclass! Puzzle 91: Serial Killer Puzzle 92: Twisted Pair Puzzle 93: Class Warfare Puzzle 94: Lost in the Shuffle Puzzle 95: Just Desserts Appendix A. ...
解决Android studio 添加butterknife依赖,运行报错。
EClipse:web项目中某一.jps页面忽然出现错误,鼠标点上去为:The superclass "javax.servlet.http.HttpServlet" was not found on the Java Build Path. 一招解决!
现象: … java: 1801: method does not override a method from its superclass @Override… 原因: Eclipse is defaulting to Java 1.5 and you have classes implementing interface methods (which in Java 1.6 ...
每当一個类被载入时,JVM就自动为其生成一个Class对象,通过操作class对象,我们可以得到该对象的所有成员并操作它们 public ... System.out.println("SuperClass: "+ stringClass.getSuperclass().getName()); } }
class ClassName(superclass1, superclass1) data = value #类变量 def general_method(self, param): self.member = value @staticmethod def static_method(): print "This is class method" pass ...
本篇幅内容较多,但是干货满满,不仅涉及源码分析还涉及模拟系统计算分配流程,建议分次食用,耐心看完相信会有很多收获~
superclass = Parent . prototype } // создали базовый класс function Animal ( . . ) { ... } // создали класс // и сделали его потомком базовог...
NULL 博文链接:https://thaipine.iteye.com/blog/2354220
JavaWeb在线商城开发知识总结(java+jsp+servlet+MySQL+jdbc+css+js+jQuery) 可以实现浏览商品,查看商品详情,添加购物车,计算价格等功能 项目文章:...
[深入剖析Tomcat]一书第二章中 一个简单的servlet容器实现
(b) The type of relationship that does not belong anywhere (c) The type of relationship between entities of one entity type (d) The relationship type where the related entities are one and the same...
最近涉及到的一个项目中,需要实现ComboBoxTree的效果,首先,看看效果吧…… 在Extjs中是没有这种效果的,所以... Ext.ux.TreeCombo.superclass.constructor.call(this, Ext.apply({ maxHeight: 300, editable: false
System.out.println("in SuperClass.doSomething()"); } } class SubClass extends SuperClass { int x; SubClass( ) { super( );//调用父类的构造方法 x=5;//super( ) 要放在方法中的第一句 System....
Ext.form.TextArea.superclass.onRender.call(this, ct, position); CKEDITOR.replace(this.id, this.config.CKConfig); }, setValue : function(value){ Ext.form.TextArea.superclass.setValue.apply(this...
invoke method of superclass Source Code for Linux.
Ext.form.HtmlEditor.superclass.onRender.call(this, ct); this.tid = new Date().getTime(); this.textarea = Ext.get(document.createElement('textarea')); this.textarea.setWidth(this.width); this....
解决大型和小型应用程序存在的常见问题和陷阱。 要容易写。文档楷模活动应用程序 诺亚Noa 有0 个依赖项。 支持 IE >= 9。 N 包含静态方法的主要N对象。 N.extends` 轻松创建继承: N.extends(Superclass, Class def...
解决大型和小型应用程序存在的常见问题和陷阱。 要容易写。 文档 活动 应用程序 只是 只有0 个依赖项。 支持 IE >= 9。 J 包含静态方法的主要J对象。 J.extends` 轻松创建继承: J.extends(Superclass, Class...