²»ÓÃ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
Ïà¹ØÎĵµ£º
create PROCEDURE pagelist
@tablename nvarchar(50),
@fieldname nvarchar(50)='*',
@pagesize int output,--ÿҳÏÔʾ¼Ç¼ÌõÊý
@currentpage int output,--µÚ¼¸Ò³
@orderid nvarchar(50),--Ö÷¼üÅÅÐò
@sort int,--ÅÅÐò·½Ê½£¬1±íʾÉýÐò£¬0±íʾ½µÐòÅÅÁÐ
......
//Number 11 ¹ýÂË×Ö·û´®ÖеķÇÊý×Ö×Ö·û
import java.util.regex.*;
import java.util.Scanner;
public class GuoLv{
public static void main(String args[]){
Scanner reader = new Scanner(System.in);
  ......
public class Factory {
private static Factory factory;
private static Object classLock=Factory.class;
private Factory(){}
public static Factory getFactory(){
synchronized(classLock){
......
Ḭ̈߳²È«µÄ¼¯ºÏ°üº¬2¸öÎÊÌâ
1.¶àÏ̲߳¢·¢ÐÞ¸ÄÒ» ¸ö ¼¯ºÏ Ôõô°ì£¿
2.Èç¹ûµü´úµÄ¹ý³ÌÖÐ ¼¯ºÏ ±»ÐÞ¸ÄÁËÔõô°ì£¿
a.Ò»¸öÏß³ÌÔÚµü´ú£¬ÁíÒ»¸öÏß³ÌÔÚÐÞ¸Ä
b.ÔÚͬһ¸öÏß³ÌÄÚÓÃͬһ¸öµü´úÆ÷¶ ......
³ÌÐòÉè¼ÆÖо³£»áÅöµ½ÓÃ×é¼þÀ´ÏÔʾͼƬµÄÇé¿ö, ¿ÉÒÔÏÔʾͼƬµÄ×é¼þÓкܶà,Èçawt°üÖеÄbutton,label,panelµÈ¶¼¿ÉÒÔÔÚÆäÉÏÃæ·ÅÖÃͼƬ.ͼƬÓÖ¿É·ÖΪÁ½Àà,Ò»ÀàÊÇ·ÅÖÃÓÚbuttonµÈ×é¼þÉϵÄImageIcon(ͼ±ê),ÁíÒ»ÀàÊÇ¿ÉÒÔ·ÅÖÃÔÚpanelµÈ×é¼þÉϵĽϴóµÄͼƬImage¡£
´Ó±¾µØ¼ÆËã»úÖжÁȡͼƬµÄ·½·¨Ò²Óкܶ࣬±ÈÈ磬 ......