【正文】
9] Kevin husted 著 .JSP 站點(diǎn)設(shè)計(jì)編程指南 [M].電子工業(yè)出版社 . [10] 汪孝宜 .劉中 兵 .徐佳晶等著 .JSP 數(shù)據(jù)庫(kù)開(kāi)發(fā)實(shí)例精粹 [M] .電子工業(yè)出版社 . [11] Elliote Rusty Harold,DavidFlanaga 著 .Java Network Programming. O39。 3, connect to the database Driver manager keeps a list of registered drivers, call the getConnection () method get Connection object. One getConnection () the parameters are the database server IP address, port number, bank name and account number required for login and password database, the sample is as follows: Connection conn = ( jdbc: oracle: thin: localhost: 1521: demo, username, password)。 m_timer timer. These attributes define the connection pool with which status values for each valid connection. Selfmanaged connection pool, in fact, by periodically on the status of each connection and the number of connections carried out to determine the appropriate action. Here you can define ConnectionPool management needs to plete the basic interface, the concrete below: public class ConnectionPool implements TimerListener { public boolean initialize () / / initialize the connection pool public void destroy () / / destroy the connection pool public synchronized getConnection () / / get a connection public synchronized void close () / / Close a connection private synchronized void removeFromPool () / / to delete a connection from the connection pool private synchronized void fillPool () / / maintain the connection pool size public synchronized void TimerEvent () / / timer event handler } Through these interfaces, they can already pleted the basic management connection pool. In TimeEvent () function to plete the state inspection of the connection pool, fillPool () when the connection pool for at least the minimum number of connections. Because users want to save the state of each connection, so it requires a database connection object below: class ConnectionObject { public con。 Web 數(shù)據(jù)庫(kù)系統(tǒng)充分發(fā)揮了 DBMS 高效的數(shù)據(jù)存儲(chǔ)與管理能力,以 B/S 模式為平臺(tái),將客戶端統(tǒng)一為Web 瀏覽器,為用戶提供使用簡(jiǎn)便、內(nèi)容豐富的數(shù)據(jù)庫(kù)服務(wù),已經(jīng)成為 Inter 和 Intra 提 供的核心服務(wù),為 Inter 上的電子商務(wù)提供技術(shù)支持。它主要由接口組成而不是集成類,被包含在 和 兩個(gè)包中。 JSP 技術(shù)的特點(diǎn) Java Server Page(JSP)是使用 Java 代碼動(dòng)態(tài)生成 HTML 文檔的 Web 頁(yè)面摸板。如果 Servlet 實(shí)例并未運(yùn)行,容器載入該 Servlet 類 ,并創(chuàng)建一個(gè)實(shí)例。問(wèn)題不在于技術(shù)的能力,而是二者在便利性、生產(chǎn)率和可維護(hù)性上的不同。 Web 開(kāi)發(fā)人員可以將經(jīng)理集中在表示層( presentation layer)上。這是一項(xiàng)有用的功能,一般與 JSP 的功能(只在服務(wù)器端運(yùn)行)并不發(fā)生重疊。而且對(duì)于 CGI 來(lái)說(shuō),每一個(gè)訪問(wèn)就需要新增加一個(gè)進(jìn)程來(lái)處理,進(jìn)程不斷地建立和銷毀對(duì)于作為Web 服務(wù)器的計(jì)算機(jī)將是不小的負(fù)擔(dān)。其中 getConnection()的參數(shù)分別是數(shù)據(jù)庫(kù)服務(wù)器的 IP 地址、端口號(hào)、庫(kù)名和登錄數(shù)據(jù)庫(kù)所需的賬號(hào)與密碼,示例如下: Connection conn= ( jdbc:oracle:thin:localhost:1521:demo,username,password); SQL 語(yǔ)言由從一個(gè)關(guān)系數(shù)據(jù)庫(kù)中創(chuàng)建、表示和抽取數(shù)據(jù)的語(yǔ)句組成。 ConnectionPool 的基本屬性如下: m_ConnectionPoolSize 連接池中連接數(shù)量下限; m_ConnectionPoolMax 連接池中連接數(shù)量上限; m_ConnectionUseCount 一個(gè)連接的最大使用次數(shù); m_ConnectionTimeout 一個(gè)連接的最長(zhǎng)空閑時(shí)間; m_MaxConnections = 1 同一時(shí)間的最大連接數(shù); m_timer 定時(shí)器。 //最近一次開(kāi)始使用時(shí)間 public int useCount。用戶應(yīng)該全面考慮系統(tǒng)中的各個(gè)部分 ,這樣才能充分發(fā)揮其高效性。 關(guān)鍵詞: JSP MyEclipe mysql 投票 ABSTRACT With the fastly development of the inter and the inter application,Online Voting system have bee a more monly and usually in some newsleleasing site or other large portals voting system always stands a important and irreplaceable can integrate user and Web sites preferable,thus it can acheieve the purpse of the Inter to share the original manual management alone or simple standalone management, management faced a lot of information and can not be efficiently extracted from one of the important part, and make the appropriate judgments and processing. Vote only in accordance with management decisionmaking table data manually, wasting a lot of manpower and material resources at the same time can not do realtime monitoring, it is difficult to ensure data accuracy and timeliness. The system uses a mon puter language JSP modules bases on the operating system of windows XP, and use , mysql tools such as design and development。因此,本系統(tǒng)采用 SSH 框架 ,以操作系統(tǒng) Windows 作為開(kāi)發(fā)平臺(tái),并且使用 、 mysql等工具 設(shè)計(jì) 開(kāi)發(fā) ; 并介紹了系統(tǒng)的調(diào)試、運(yùn)行環(huán)境、系統(tǒng)功能、系統(tǒng)設(shè)計(jì)以及系統(tǒng)實(shí) 現(xiàn)。 //返回連接,此時(shí)并沒(méi)有關(guān)閉連接,只是放回了連接池 DestroyPool()。在 TimeEvent()函數(shù)中完成連接池的狀態(tài)檢驗(yàn)工作, fillPool()時(shí)連接池至少保持最小連接數(shù)。 一個(gè)結(jié)果集是表格行的排序列表,使用 JDBC 中的 接口表示。很多關(guān)系數(shù)據(jù)庫(kù)管理系統(tǒng)都帶有 JDBC 驅(qū)動(dòng)程序。 JavaScript 也可以用在服務(wù)器端,最因人注意的是 SUN ONE(以前的 iPla)、 IIS 和BroadVision 服務(wù)器。幾乎所有的項(xiàng)目都會(huì)同時(shí)用到這兩種技術(shù)。 (2) 能夠使用標(biāo)準(zhǔn)的網(wǎng)站開(kāi)發(fā)工具。其中,偽指令是指示 JSP 容器生成什么代 碼的命令;在表達(dá)式和 Script 中可以使用 9 個(gè)隱含對(duì)象;行為是創(chuàng)建、修改或使用對(duì)象的高層 JSP 元素,使用嚴(yán)格的 XML 語(yǔ)法編碼。同時(shí) JSP 頁(yè)面還具有自身的優(yōu)點(diǎn),如需要時(shí)自動(dòng)重新編譯和與 Web 開(kāi)發(fā)工具具有更大的兼容性。 JDBC 驅(qū)動(dòng)提供 JDBC API 的接口類。 WebAPI 的出現(xiàn)克服了速度問(wèn)題,但是開(kāi)發(fā)更加困難。 / / is the frequency of use } Joined ConnectionObject object, operating in the ConnectionPool should only ConnectionObject, and other processes need is ConnectionObject the con attributes. So here then add as a class, as other processes to obtain and return the connection interface: CLASS Conn { GetConnection ()。 m_ConnectionPoolMax maximum number of connections the connection pool。 connect to the database and the corresponding actual treatment. JDBC driver provides JDBC API interface classes. JSP technique The Java Server Pages( JSP) is a kind of according to web of the script plait distance technique, similar carries the script language of Java in the server of the Netscape pany of server side JavaScript( SSJS) and the Active Server Pages( ASP) of the pares the SSJS and ASP to have better can expand sex, and it is no more exclusive than any factory or some one particular server of Web. Though the norm of JSP is to be draw up by the Sun pany of, any factory can carry out the JSP on own system. Features of JSP technology Java Server Page (JSP) is the use of Java code dynamically generated Web pages Moban HTML document. JSP running on the server side ponent, called the JSP container, it transformed into an equivalent JSP Java Servlet. Because of this, Servlet and JSP page is ultimately related. JSP pages have all the ad