jsp連線資料庫oracle

2022-03-29 20:42:20 字數 828 閱讀 3347

create table test(test1 varchar(20),test2 varchar(20)

然後向這個表寫入一條測試紀錄

那麼現在開始我們的jsp(sun企業級應用的首選)和資料庫之旅吧。

testoracle(大型**資料庫平台).jsp(sun企業級應用的首選)如下:

(大型**資料庫平台).jdbc.driver.oracle(大型**資料庫平台)driver").newinstance();   

string url="jdbc:oracle(大型**資料庫平台):thin:@localhost:1521:orcl";

//orcl為你的資料庫的sid

string user="scott";

string password="tiger";

connection conn= drivermanager.getconnection(url,user,password);   

statement stmt=conn.createstatement(resultset.type_scroll_sensitive,resultset.concur_updatable);   

string sql="select * from test";   

resultset rs=stmt.executequery(sql);   

while(rs.next()) {%>   

您的第乙個字段內容為:   

您的第二個字段內容為:   

stmt.close();   

conn.close();   

%>   

jsp連線資料庫大全

create table test test1 varchar 20 test2 varchar 20 一 jsp連線oracle8 8i 9i資料庫 用thin模式 orcl為你的資料庫的sid pubs為你的資料庫的 三 jsp連線db2資料庫 sample為你的資料庫名 testdb為你的資料...

JSP連線資料庫大全

一 jsp連線oracle8 8i 9i資料庫 用thin模式 testoracle.jsp如下 class.forname oracle.jdbc.driver.oracledriver newinstance string url jdbc oracle thin localhost 1521 ...

jsp連線資料庫大全

現在有好多初學jsp sun企業級應用的首選 的經常會問資料庫怎麼連線啊,怎麼老出錯啊?所以我集中的在這寫篇文章供大家參考,其實這種把資料庫邏輯全部放在jsp sun企業級應用的首選 裡未必是好的做法,但是有利於初學者學習,所以我就這樣做了,當大家學到一定程度的時候,可以考慮用mvc的模式開發。在練...