ͨ¹ý DAOFactory µÄ·ºÐÍд·¨À´ÑÝʾJava·ºÐ͵ÄÌØÊâÓ÷¨
ͨ¹ý DAOFactory µÄ·ºÐÍд·¨À´ÑÝʾJava·ºÐ͵ÄÌØÊâÓ÷¨
СÐÍÏîÄ¿Öг£³£¶¼Ã»ÓÐÓÃÈý·½³Ö¾Ã»¯¿ò¼Ü£¬¶ø´ó¶¼ÊÇÓù«Ë¾»ò×ÔÐÐÒÀ¾ÝDAOģʽ·â×°µÄһЩ×é¼þÀ´Íê³ÉÊý¾Ý¿â³Ö¾Ã»¯¶¯×÷£¬²¢ÇÒ£¬Í¨³£ÎªÁ˸ü¾ß¿ÉÀ©Õ¹ÐÔ£¬³£³£Ê¹ÓóéÏ󹤳§Ä£Ê½À´½âñîºÏ¡£
Ò»¡¢ÏÈ¿´´úÂë
1¡¢¼òµ¥¹¤³§´úÂë
/*****************************************************************************/
/* Title: DAOFactory 1.0 */
/* Description: DAOFactory 1.0 Java Source Code. */
/* Copyright: Copyright(c) 2009 - CodingMouse, Inc. All rights are reserved. */
/* Company: CodingMouse's Java R&D Studio */
/* */
/* Created in August 8, 2009 */
/*****************************************************************************/
package com.china.codingmouse.cmsdk4j.dao.factory;
import java.io.Serializable;
import com.china.codingmouse.cmsdk4j.config.CmSdk4jConfigurationReader;
import com.china.codingmouse.cmsdk4j.dao.generaldao.GeneralDAO;
import com.china.codingmouse.cmsdk4j.dao.generaldao.IGeneralDAO;
import com.china.codingmouse.cmsdk4j.dao.genericsdao.GenericsDAO;
import com.china.codingmouse.cmsdk4j.dao.genericsdao.IGenericsDAO;
import com.china.codingmouse.cmsdk4j.exception.GeneralException;
/**
* Êý¾Ý·ÃÎʹ¤³§¡£<br><br>
*
* ÓÃÓÚ·â×°³£¹æÒÔ¼°·ºÐÍÊý¾Ý·ÃÎʶ¯×÷ʵÏֵĹ¹½¨¡£
* @param <T> ·ºÐÍÀàÐͲÎÊý¡£
* @author CodingMouse
* @version 1.0
* @see AbstractDAOFactory
* @since JDK1.5
*/
public class DAOFactory<T extends Serializable> extends AbstractDAOFactory<T> {
/**
* ¹¹½¨³£¹æÊý¾Ý·ÃÎʶ¯×÷ʵÀý¡£
* @return ³£¹æÊý¾Ý·ÃÎʶ¯×÷½Ó¿ÚʵÀý¡£
*/
@Override
public IGeneralDAO buildGeneralDAO() {
try {
// ´ÓÅäÖõµÖжÁÈ¡³£¹æÊý¾Ý·ÃÎʶ¯×÷ʵÏÖÀàÍêÈ«ÏÞ¶¨Ãû
String className = CmSdk4jConfigurationReader.getInstance().getBaseSetting(false).get
Ïà¹ØÎĵµ£º
ÏßÐÔ±í£¬Á´±í£¬¹þÏ£±íÊdz£ÓõÄÊý¾Ý½á¹¹£¬ÔÚ½øÐÐJava¿ª·¢Ê±£¬JDKÒѾΪÎÒÃÇÌṩÁËһϵÁÐÏàÓ¦µÄÀàÀ´ÊµÏÖ»ù±¾µÄÊý¾Ý½á¹¹¡£ÕâЩÀà¾ùÔÚjava.util°üÖС£±¾ÎÄÊÔͼͨ¹ý¼òµ¥µÄÃèÊö£¬Ïò¶ÁÕß²ûÊö¸÷¸öÀàµÄ×÷ÓÃÒÔ¼°ÈçºÎÕýȷʹÓÃÕâЩÀà¡£
<o:p></o:p>
Collection
©ÀList
©¦©ÀLinkedList
©¦©ÀArrayList
©¦©¸Vector ......
public class VariableParameter {
public static void main(String[] args) {
System.out.println(add(1,2));
System.out.println(add(1,2,3,4));
}
public static int add(int x,int...args){
//ÊÇ3¸öµã£¬args±ØÐëÊÇ ......
package io;
import java.io.*;
/**
* @author ¸ßÕíÎâÓÇ
* ÀûÓûº³åÇøÔÀí,BufferedInputStream,
* ʵÏÖµÄÎļþ×Ö½ÚÁ÷¶ÁÈ¡¹¦ÄÜʾ·¶
*
*/
public class BufferedInOutputStream { & ......
·½°¸Ò»²½Ö裺
1¡¢ÅäÖÃTomcat\conf\context.xmlÌí¼Ó <Resource>
<Resource name="jdbc/books" auth="Container"
type="javax.sql.DataSource" maxActive="100" maxIdle="30"
maxWait="10000" username="sa" password=""
driverClassName="com.microsoft.jdbc.sqlse ......
1£® ¹ØÓÚ»ù´¡Êý¾ÝÀàÐÍ¡£
»¹¼ÇµÃÉÏһƬÎÄÕÂÖнáβ²¿·ÖµÄÄǸöÀý×Óô£¿
ÒòΪ¼ÆËã»úµÄ2½øÖƵÄÌØÐÔ£¬JavaÓïÑÔ£¨ÆäËûÓïÑÔºÃÏñÒ²Ò»Ñù£©ÎÞ·¨×¼È·µØ½øÐÐfloat,doubleÀàÐÍÊý¾ÝµÄ¼ÆË㣬ËùÒÔ£¬×÷ÕâЩ¼ÆËãµÄʱºòÐèÒª¿¼ÂÇʹÓÃBigDecimalן÷Àà¡£
2£® StringÀàÓëStringBufferÀà
JavaµÄStringÀàÌṩÈçϵļòµ¥µÄ×Ö·û´®Á¬½Ó·½· ......