JSPÊý¾Ý¿âÁ¬½ÓÒÉÎÊ£¨Mysql£©
package com.wxpn.tutorial.db;
import java.io.IOException;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;
import java.sql.SQLWarning;
import java.sql.Statement;
import java.util.Date;
/**
* ÃèÊö: Êý¾Ý¿âÁ¬½Ó³ØÀà
*
*
* @version 1.0
*/
public class ConnectionPool implements Runnable {
private boolean _debug = false;
private Thread runner;
private Connection[] connPool;
private int[] connStatus; // (0) available; (1) locked by the client; (2)
// locked by the housekeeping thread
private long[] connLockTime;
private long[] connCreateTime;
private String[] connID;
private String dbdriver, dbserver, dbuser, dbpassword;
private int currConnections, connLast, minconns, maxconns, maxconnMSec;
// available: set to false on destroy, checked by getConnection()
private boolean available = true;
private SQLWarning currSQLWarning;
/**
* Creates a new Connection Broker<br>
*
* @param dbdriver
* JDBC driver. e.g. 'oracle.jdbc.driver.OracleDriver'<br>
* @param dbserver
* JDBC connect string. e.g.
* 'jdbc:oracle:thin:@203.92.21.109:1526:orcl'<br>
* @param dbuser
* Database login name. e.g. 'Scott'<br>
* @param dbpassword
* Database password. e.g. 'Tiger'<br>
* @param minconns
* Minimum number of connections to start with.<br>
* @param maxconns
* &
Ïà¹ØÎĵµ£º
1£® °²×°Cygwin
ÔËÐÐCygwinµÄ°²×°³ÌÐò¡£´ÓÎļû°üµÄµÄÁбíÖУ¬ÔÚDEVÀïÃ棬ȷ¶¨ÒªÑ¡Ôñ
• Ruby
• gcc
• subversion
ÄãÐèҪʹÓÃgccÀ´½¨Á¢Cygwin°æ±¾µÄMySQL.
2. ÔÚwindowsÉÏÃæ°²×°MYSQL£º
download MySQL 5.0 Windows Installer
3£® & ......
Ä¿Ç°£¬×î³£ÓõÄÈýÖÖ¶¯Ì¬ÍøÒ³ÓïÑÔÓÐASP(Active Server Pages),JSP(Java Server Pages),
PHP (Hypertext Preprocessor)¡£
¼ò ½é
¡¡¡¡ASPÈ«ÃûActive Server & ......
Æô¶¯mysqlµÄ·þÎñ¾³£·¢ÏÖ1067Õâ¸ö´íÎ󡣲鿴ʼþÈÕÖ¾ÒÔºó·¢ÏÖÏÂÃæµÄ´íÎóÐÅÏ¢
Unknown/unsupported table type: INNODB
ÈçºÎ½â¾ö£ºÔÚmysqlÊý¾Ý´æ·ÅĿ¼ÏÂÕÒµ½ ibdata ÒÔ¼°ib_logfile0¡¢ib_logfile1ɾµôÔÙÆô¶¯¾ÍºÃÁË ......
ת×Ôhttp://www.linuxbyte.org/yi-ge-mysql-server-shang-de-xiao-ji-qiao.html
ÔÚmy.cnf µÄ mysql ¶Ë Ìí¼ÓÈçÏÂÉèÖÃ
[mysql]
#no-auto-rehash # faster start of mysql but no tab completition
prompt="(\u:mysql1@linuxbyte.org \R:\m)[\d]: "
»á²úÉúÈçÏÂЧ¹û:
root@ubuntu:/home/hew# mysql -u hew -p
Enter pass ......
JSP¾Å´ó¶ÔÏó£º
ÄÚÖöÔÏó£¨ÓÖ½ÐÒþº¬¶ÔÏó£¬ÓÐ9¸öÄÚÖöÔÏó£©:²»ÐèÒªÔ¤ÏÈÉùÃ÷¾Í¿ÉÒÔÔڽű¾´úÂëºÍ±í´ïʽÖÐËæÒâʹÓÃ
1-out:
javax.servlet.jsp.JspWriterÀàÐÍ£¬´ú±íÊä³öÁ÷µÄ¶ÔÏó¡£×÷ÓÃÓòΪpage£¨Ò³ÃæÖ´ÐÐÆÚ£©
request£ºjavax.servlet.ServletRequestµÄ×ÓÀàÐÍ£¬´Ë¶ÔÏó·â×°ÁËÓÉWEBä¯ÀÀÆ÷»òÆäËü¿Í»§¶ËÉú³ÉµØHTTP
ÇëÇóµÄϸ½Ú£¨² ......