易截截图软件、单文件、免安装、纯绿色、仅160KB

不用spring,hibernate超傻瓜JAVA开发(javabean+数组)

javabean+数组优点:
1、简单:java程序中最简单的类莫过于javabean,javabean有一套成熟的规范,易于编写
2、方便:javabean是数据的载体,既可以通过set和get方式来操作数据,又可以象使用数组一样来操作javabean
3、通用:通过下标来操作javabean,你所写的代码将是通用的,可移植的。你所写的功能组件将适用于所有的javabean
4、0配置:通过数组来对javabean进行说明配置,比XML文件更清晰
5、易于修改:程序中不再有任何SQL语句,数据结构发生改变,只要修改javabean即可
6、易于维护:由于第3点的通用性,你只需要维护页面及操作逻辑。
7、傻瓜性:会操作数组就会使用,所以没有任何学习曲线
示例:
package com.askyear.demo.bean;
import java.util.Date;
import com.askyear.db.ATable;
import com.askyear.db.key.String32Key;
/**
* 用户
*
* @author askyear.com
*
*/
public class User extends ATable {
public static final String USER_SESSION = "user";
private static final long serialVersionUID = -8942196092377147945L;
private String member;
private String name;
private String password;
private String email;
private String type;
private Boolean useable;
private Date createTime;
public User() {
this.initSelf();
}
public void buildKeyIfNull() {
if (this.member == null || this.member.length() == 0) {
this.member = String32Key.getKeyValue();
}
if (this.useable == null)
this.useable = true;
if (this.createTime == null)
this.createTime = new Date();
}
public Object getPropertyValue(int index) {
switch (index) {
case 0:
return member;
case 1:
return name;
case 2:
return password;
case 3:
return email;
case 4:
return type;
case 5:
return useable;
case 6:
return createTime;
default:
throw new ArrayIndexOutOfBoundsException("访问越界:" + index);
}
}
public void initSelf() {
this.setTableName("sys_user");
this.setTableChinaName("系统用户");
key = new int[] { 0 };
property = new String[] { "member", "name", "password", "email", "type", "useable", "createTime" };
field = n


相关文档:

java解析XML的四种方法

XML现在已经成为一种通用的数据交换格式,它的平台无关性,语言无关性,系统无关性,给数据集成与交互带来了极大的方便。对于XML本身的语法知识与技术细节,需要阅读相关的技术文献,这里面包括的内容有DOM(Document Object Model),DTD(Document Type Definition),SAX(Simple API for XML),XSD(Xml Schema Definition),XSLT(Exten ......

java调用com组件操作word使用总结(jacob)

一、准备工作
先了解一下概念,JACOB 就是 JAVA-COM Bridge的缩写,提供自动化的访问com的功能,也是通过JNI功能访问windows平台下的com组件或者win32系统库的。这是一个开始于 1999年的开源项目的成果,有很多使用者对该项目进行了修改,做出了自己的贡献。
Jacob下载地址:http://sourceforge.net/project/showfiles.ph ......

Java相对路径/绝对路径总结(转)

1.基本概念的理解
绝对路径:绝对路径就是你的主页上的文件或目录在硬盘上真正的路径,(URL和物理路径)例如:
C:xyz est.txt 代表了test.txt文件的绝对路径。http://www.sun.com/index.htm也代表了一个URL绝对路径。
相对路径:相对与某个基准目录的路径。包含Web的相对路径(HTML中的相对目录),例如:在
Servlet ......

Java读取配置文件

import java.util.Properties;
public class ConfigReader {
private static Properties cache = new Properties();
static{
   try {
    cache.load(ConfigReader .class.getClassLoader().getResourceAsStream("config.properties"));
   } catch (Exception e) {
 &nbs ......

线程安全的Singleton模式的Java实现

public class Factory {
private static Factory factory;
private static Object classLock=Factory.class;
   private Factory(){}
   public static Factory getFactory(){
      synchronized(classLock){
          ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号