Ò׽ؽØͼÈí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

JavaÊý¾Ý¿âÁ¬½Ó³Ø

import java.sql.Connection;
import java.sql.DatabaseMetaData;
import java.sql.Driver;
import java.sql.DriverManager;
import java.sql.SQLException;
import java.sql.Statement;
import java.util.Enumeration;
import java.util.Vector;
/*ËäÈ»ÏÖÔÚÓÃAPACHE COMMONS DBCP¿ÉÒԷdz£·½±ãµÄ½¨Á¢Êý¾Ý¿âÁ¬½Ó³Ø£¬
µ«ÊÇÏñÕâƪÎÄÕ°ÑÊý¾Ý¿âÁ¬½Ó³ØµÄÄÚ²¿Ô­ÀíдµÄÕâô͸³¹£¬×¢ÊÓÕâôÍêÕû£¬
ÕæÊǷdz£Äѵã¬Èÿª·¢ÈËÔ±¿ÉÒÔ¸üÉî²ã´ÎµÄÀí½âÊý¾Ý¿âÁ¬½Ó³Ø£¬ÕæÊǷdz£¸Ð
лÕâƪÎÄÕµÄ×÷Õß¡£*/
public class ConnectionPool {
private String jdbcDriver = ""; // Êý¾Ý¿âÇý¶¯
private String dbUrl = ""; // Êý¾Ý URL
private String dbUsername = ""; // Êý¾Ý¿âÓû§Ãû
private String dbPassword = ""; // Êý¾Ý¿âÓû§ÃÜÂë
private String testTable = ""; // ²âÊÔÁ¬½ÓÊÇ·ñ¿ÉÓõIJâÊÔ±íÃû£¬Ä¬ÈÏûÓвâÊÔ±í
private int initialConnections = 10; // Á¬½Ó³ØµÄ³õʼ´óС
private int incrementalConnections = 5;// Á¬½Ó³Ø×Ô¶¯Ôö¼ÓµÄ´óС
private int maxConnections = 50; // Á¬½Ó³Ø×î´óµÄ´óС
private Vector connections = null; // ´æ·ÅÁ¬½Ó³ØÖÐÊý¾Ý¿âÁ¬½ÓµÄÏòÁ¿ , ³õʼʱΪ null
// ËüÖдæ·ÅµÄ¶ÔÏóΪ PooledConnection ÐÍ
/**
* ¹¹Ô캯Êý
*
* @param jdbcDriver String JDBC Çý¶¯Àà´®
* @param dbUrl String Êý¾Ý¿â URL
* @param dbUsername String Á¬½ÓÊý¾Ý¿âÓû§Ãû
* @param dbPassword String Á¬½ÓÊý¾Ý¿âÓû§µÄÃÜÂë
*
*/
public ConnectionPool(String jdbcDriver, String dbUrl, String dbUsername,
String dbPassword) {
this.jdbcDriver = jdbcDriver;
this.dbUrl = dbUrl;
this.dbUsername = dbUsername;
this.dbPassword = dbPassword;

try {
createPool();
} catch (Exception e) {
e.printStackTrace();
}
}
/**
* ·µ»ØÁ¬½Ó³ØµÄ³õʼ´óС
*
* @return ³õʼÁ¬½Ó³ØÖпɻñµÃµÄÁ¬½ÓÊýÁ¿
*/
public int getInitialConnections() {
return this.initialConnections;
}
/**
* ÉèÖÃÁ¬½Ó³ØµÄ³õʼ´óС
*
* @param ÓÃÓÚÉèÖóõʼÁ¬½Ó³ØÖÐÁ¬½ÓµÄÊýÁ¿
*/
public void setInitialConnections(int initialConnections) {
this.initialConnections = initialConnections;
}
/**
* ·µ»ØÁ¬½Ó³Ø×Ô¶¯Ôö¼ÓµÄ´óС


Ïà¹ØÎĵµ£º

javaºº×Ö×Ö·û´®°´Æ´ÒôÅÅÐò

Ä¿±ê£ºÊµÏÖÒ»¸öºº×Ö×Ö·û´®°´ººÓïÆ´Òô×Öµä˳ÐòÅÅÐò¡£
Ô­Àí£ºÔÚwindows»·¾³µÄgbk×Ö·û¼¯Àºº×ÖÊÇ°´ººÓïÆ´Òô×Öµä˳Ðò±àÂëµÄ£¬Èç“´¡”ÊÇB4A1£¬“´¢”ÊÇB4A2¡£ÕâÀïÓиöÎÊÌâ¾ÍÏñÉÏÃæµÄ´¢ºÍ´¡ÕâÑùµÄͬÒô×ÖÖ»ÄÜ×ñÕÕ±àÂëµÄ˳ÐòÁË£¬ÁíÍâ¶àÒô×ÖÒ²µÃ×ñÕÕ±àÂë˳Ðò¡£Éè¼Æ˼·ÊÇÏȲð·Öºº×Ö×Ö·û´®Îª×Ö·ûÊý×飬»ñµÃÿ ......

javaÓ¦ÓÃÔ´ÂëºÃÍøÖ·

 StrutsME Ò»¸öÇáÁ¿¼¶µÄÐòÁл¯Ð­Ò飬ʹJ2ME¿Í»§¶ËÄܵ÷ÓÃStruts WebÓ¦ÓóÌÐò¡£
http://www.strutsme.org/
JsonME ÇáÁ¿¼¶ÊµÏÖJ2ME Json¡£
http://www.json.org/java/org.json.me.zip
MicroLog ÇáÁ¿¼¶µÄLOG
http://microlog.sourceforge.net/snapshot
Mobile Ajax for Java ME °üÀ¨ÁËXmlHttpRequest£¬jsonµÄÒ ......

Ubuntu JavaÏà¹ØÈí¼þ°²×° mysql jdk tomcat

Mysql
 sudo netstat -tap | grep mysql
    µ±ÄúÔËÐиÃÃüÁîʱ£¬Äú¿ÉÒÔ¿´µ½ÀàËÆÏÂÃæµÄÐУº
    linuxidc@linuxidc-laptop:~$">linuxidc@linuxidc-laptop:~$ sudo netstat -tap | grep mysql
    [sudo] password for linuxidc:
    tcp &n ......

´ÓJavaÓ¦ÓóÌÐò¶¯Ì¬Éú³ÉPDFÎļþ

 http://hi.baidu.com/skeryl/blog/item/d9b74e081e1d423ae92488ac.html
Èç¹ûÓ¦ÓóÌÐòÐèÒª¶¯Ì¬Éú³É PDF Îĵµ£¬ÔòÐèÒª iText ¿â¡£¿ª·ÅÔ´ÂëµÄ iText ¿âʹ PDF ÎĵµµÄ´´½¨Äܹ»ÔÚ˲¼äÍê³É¡£±¾ÎĽéÉÜÁË iText ²¢ÌṩÁËʹÓÃËü´Ó Java ? ¼¼ÊõÓ¦ÓóÌÐòÉú³É PDF ÎĵµµÄÓÉdzÈëÉîµÄÖ¸ÄÏ¡£ÎÒÃÇ´´½¨ÁËÒ»¸öʾÀýÓ¦ÓóÌÐòÒÔ¸üºÃµØÀí½â ......

java»ñµÃµ±Ç°Ê±¼äһСʱǰµÄʱ¼ä£¬¸ñʽ»¯³Éyyyy

       /**
     * »ñµÃµ±Ç°Ê±¼äһСʱǰµÄʱ¼ä£¬¸ñʽ»¯³Éyyyy-MM-dd HH:mm:ss:SS<br>
     *
     * @return µ±Ç°Ê±¼äһСʱǰµÄʱ¼ä
     */
    public String getOneHours ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ