JAVAÁ¬½Ó³Ø
package com.xinnuo.jdbc;
import java.io.*;
import java.sql.*;
import java.util.*;
import java.util.Date;
/*
* ¸ÃÀàÖ»ÄÜ´´½¨Ò»¸öʵÀý£¬ÆäËü¶ÔÏóÄܹ»µ÷ÓÃÆ侲̬·½·¨£¨Ò²³ÆΪÀà·½·¨£©»ñµÃ¸ÃΨһʵÀýµÄÒýÓá£
* DBConnectionManagerÀàµÄ½¨¹¹º¯ÊýÊÇ˽Óеģ¬ÕâÊÇΪÁ˱ÜÃâÆäËü¶ÔÏó´´½¨¸ÃÀàµÄʵÀý.
* DBConnectionManagerÀàµÄ¿Í»§³ÌÐò¿ÉÒÔµ÷ÓÃgetInstance()·½·¨»ñµÃ¶Ô¸ÃÀàΨһʵÀýµÄÒýÓá£
* ÀàµÄΨһʵÀýÔÚgetInstance()·½·¨µÚÒ»´Î±»µ÷ÓÃÆڼ䴴½¨£¬´ËºóÆäÒýÓþÍÒ»Ö±±£´æÔÚ¾²Ì¬±äÁ¿
* instanceÖС£Ã¿´Îµ÷ÓÃgetInstance()¶¼Ôö¼ÓÒ»¸öDBConnectionManagerµÄ¿Í»§³ÌÐò¼ÆÊý¡£
* ¼´£¬¸Ã¼ÆÊý´ú±íÒýÓÃDBConnectionManagerΨһʵÀýµÄ¿Í»§³ÌÐò×ÜÊý£¬Ëü½«±»ÓÃÓÚ¿ØÖÆÁ¬½Ó³ØµÄ
* ¹Ø±Õ²Ù×÷¡£ ¸ÃÀàʵÀýµÄ³õʼ»¯¹¤×÷˽Óз½·¨init()Íê³É¡£ÆäÖÐ getResourceAsStream()·½·¨
* ÓÃÓÚ¶¨Î»²¢´ò¿ªÍⲿÎļþ¡£ÍⲿÎļþµÄ¶¨Î»·½·¨ÒÀÀµÓÚÀà×°ÔØÆ÷µÄʵÏÖ¡£±ê×¼µÄ±¾µØÀà×°ÔØÆ÷²éÕÒ²Ù
* ×÷×ÜÊÇ¿ªÊ¼ÓÚÀàÎļþËùÔÚ·¾¶£¬Ò²Äܹ»ËÑË÷CLASSPATHÖÐÉùÃ÷µÄ·¾¶¡£db.propertiesÊÇÒ»¸öÊôÐÔ
* Îļþ£¬Ëü°üº¬¶¨ÒåÁ¬½Ó³ØµÄ¼ü-Öµ¶Ô¡£¿É¹©¶¨ÒåµÄ¹«ÓÃÊôÐÔÈçÏ£º
* drivers ÒÔ¿Õ¸ñ·Ö¸ôµÄJDBCÇý¶¯³ÌÐòÀàÁбí\\
* logfile ÈÕÖ¾ÎļþµÄ¾ø¶Ô·¾¶
* ÆäËüµÄÊôÐÔºÍÌض¨Á¬½Ó³ØÏà¹Ø£¬ÆäÊôÐÔÃû×ÖÇ°Ó¦¼ÓÉÏÁ¬½Ó³ØÃû×Ö£º
* < poolname>.url Êý¾Ý¿âµÄ JDBC URL
* < poolname>.maxconn ÔÊÐí½¨Á¢µÄ×î´óÁ¬½ÓÊý£¬0±íʾûÓÐÏÞÖÆ
* < poolname>.user ÓÃÓÚ¸ÃÁ¬½Ó³ØµÄÊý¾Ý¿âÕʺÅ
* < poolname>.password ÏàÓ¦µÄÃÜÂë\\
* ÆäÖÐurlÊôÐÔÊDZØÐèµÄ£¬¶øÆäËüÊôÐÔÔòÊÇ¿ÉÑ¡µÄ¡£Êý¾Ý¿âÕʺźÍÃÜÂë±ØÐëºÏ·¨¡£ÓÃÓÚWindowsƽ̨µÄ
* db.propertiesÎļþʾÀýÈçÏ£º
* drivers=com.microsoft.jdbc.sqlserver.SQLServerDriver
* logfile=D:\\log.txt
* access.maxconn=20
* access.url=jdbc:microsoft:sqlserver://localhost:1433;databasename=web
* access.user=sa
* access.passw
Ïà¹ØÎĵµ£º
Javaѧϰ´ÓÈëÃŵ½¾«Í¨
Ò»¡¢ JDK (Java Development Kit)
JDKÊÇÕû¸öJavaµÄºËÐÄ£¬°üÀ¨ÁËJavaÔËÐл·¾³£¨Java Runtime Envirnment£©£¬Ò»¶ÑJava¹¤¾ßºÍJava»ù´¡µÄÀà¿â(rt.jar)¡£²»ÂÛʲôJavaÓ¦Ó÷þÎñÆ÷ʵÖʶ¼ÊÇÄÚÖÃÁËij¸ö°æ±¾µÄJDK¡£Òò´ËÕÆÎÕJDKÊÇѧºÃJavaµÄµÚÒ»²½¡£×îÖ÷Á÷µÄJ ......
Ê®½øÖÆת³ÉÊ®Áù½øÖÆ£º
Integer.toHexString(int i)
Ê®½øÖÆת³É°Ë½øÖÆ
Integer.toOctalString(int i)
Ê®½øÖÆת³É¶þ½øÖÆ
Integer.toBinaryString(int i)
Ê®Áù½øÖÆת³ÉÊ®½øÖÆ
Integer.valueOf("FFFF",16).toString()
°Ë½øÖÆת³ÉÊ®½øÖÆ
Integer.valueOf("876",8).toString()
¶þ½øÖÆתʮ½øÖÆ
Intege ......
JAVA ÀàÒýÓÃÓг£Óõ½µÄÓÐÈýÖУº
µÚÒ»ÖÖ :super ÊǸ¸ÀàÒýÓã¬Í¨¹ýËü¿ÉÒÔ·ÃÎʸ¸ÀàµÄÊôÐԺͷ½·¨¡£
µÚ¶þÖÖ £ºthisÊǵ±Ç°ÀàµÄÒýÓá£Í¨¹ýËû¿ÉÒÔ·ÃÎʵ±Ç°ÀàµÄ·½·¨ºÍÊôÐÔ¡£
µÚÈýÖÖ£º×ÓÀàµÄÒýÓã¬ÎÒ³£Óø¸ÀàµÄ¶ÔÏóÈ¥·ÃÎÊ×ÓÀàµÄ¶ÔÏóÀ´ÊµÏÖ¶à̬¡£ÀýÈ磺ˮ¹ûÀà Ë®¹û=new Æ»¹ûÀࣨ£©£»
ÕâÑùÎÒÃÇ¿ÉÒÔͨ¹ý Ë®¹ûÕâ¸ö¶ÔÏóÈ¥·ÃÆ»¹ûÀ ......
package mylib.webxml;
//~--- JDK imports ------------------------------------------------------------
import java.io.IOException;
import java.io.InputStream;
import java.net.HttpURLConnection;
import java.net.URL;
/**
*
* @author jmp esp
* @version 1.0
*
&nbs ......
Enum×÷ΪSunÈ«ÐÂÒý½øµÄÒ»¸ö¹Ø¼ü×Ö£¬¿´ÆðÀ´ºÜÏóÊÇÌØÊâµÄclass, ËüÒ²¿ÉÒÔÓÐ×Ô¼ºµÄ±äÁ¿£¬¿ÉÒÔ¶¨Òå×Ô¼ºµÄ·½·¨£¬¿ÉÒÔʵÏÖÒ»¸ö»òÕ߶à¸ö½Ó¿Ú¡£ µ±ÎÒÃÇÔÚÉùÃ÷Ò»¸öenumÀàÐÍʱ£¬ÎÒÃÇÓ¦¸Ã×¢Òâµ½enumÀàÐÍÓÐÈçϵÄһЩÌØÕ÷¡£
¡¡ ......