新聞中心
這里有您想知道的互聯(lián)網(wǎng)營(yíng)銷解決方案
ASP到JSP的轉(zhuǎn)換:對(duì)于相同功能處理的比較
一、目的:

通過(guò)ASP與JSP對(duì)于相同功能處理的比較,研究和實(shí)現(xiàn)從ASP到JSP的轉(zhuǎn)換。從實(shí)際應(yīng)用考慮,我們選取了與數(shù)據(jù)庫(kù)相關(guān)的一些有代表性的功能,包括三個(gè)具體功能:查詢、添加以及刪除。
二、頁(yè)面功能介紹:
1. 數(shù)據(jù)庫(kù)名稱以及表名稱(共用)
- database name:pdtdb
- table name:pdtinfotable
所用表結(jié)構(gòu)(共用)
- create table pdtinfotable
- (
- ID char(20) not null,
- ProductName char(20) ,
- primary key(ID)
- )
2.各頁(yè)面功能說(shuō)明
***個(gè)index,addaction用2個(gè)頁(yè)面:
- index: select * from table
- submit insert value(ID, ProductName) go to "addaction"
- addaction: get parameter: "ID" and "ProductName";
- Do the "insert function " go back "index"
第二個(gè)search用1個(gè)頁(yè)面 :
- select * from table where ID= parameter "ID" or ProductName= paramenter "ProductName"
- submit "ID" and "ProductName"
第三個(gè)delete,deleteaction用2個(gè)頁(yè)面:
- delete: select * from table
每個(gè)行后面又一個(gè)超鏈接(鏈到deleteaction).
- deleteaction: delete from pdtinfo where ID= parameter "ID" ,go back "delete"
3.JavaBean
使用 tax.mydb.class
三、代碼詳細(xì)比較:
ASP到JSP,index:
- strConnection = "DSN=pdtdb;Database=pdtdb;"
- Set objConn=Server.CreateObject("ADODB.Connection")
- objConn.Open strConnection
- Set objRS=Server.CreateObject("ADODB.Recordset")
- Set objRS.ActiveConnection=objConn
ASP到JSP,addaction
- strConnection = "DSN=pdtdb;Database=pdtdb;"
- Set objConn=Server.CreateObject("ADODB.Connection")
- objConn.Open strConnection
- Set objRS=Server.CreateObject("ADODB.Recordset")
- Set objRS.ActiveConnection=objConn
ASP到JSP,search:
- strConnection = "DSN=pdtdb;Database=pdtdb;"
- Set objConn=Server.CreateObject("ADODB.Connection")
- objConn.Open strConnection
- Set objRS=Server.CreateObject("ADODB.Recordset")
- Set objRS.ActiveConnection=objConn
ASP到JSP,delete
- strConnection = "DSN=pdtdb;Database=pdtdb;"
- Set objConn=Server.CreateObject("ADODB.Connection")
- objConn.Open strConnection
- Set objRS=Server.CreateObject("ADODB.Recordset")
- Set objRS.ActiveConnection=objConn
ASP到JSP,deleteaction
- strConnection = "DSN=pdtdb;Database=pdtdb;"
- Set objConn=Server.CreateObject("ADODB.Connection")
- objConn.Open strConnection
- Set objRS=Server.CreateObject("ADODB.Recordset")
- Set objRS.ActiveConnection=objConn
網(wǎng)站欄目:ASP到JSP的轉(zhuǎn)換:對(duì)于相同功能處理的比較
分享URL:http://www.5511xx.com/article/cdeeeeh.html


咨詢
建站咨詢
