中文字幕在线观看,亚洲а∨天堂久久精品9966,亚洲成a人片在线观看你懂的,亚洲av成人片无码网站,亚洲国产精品无码久久久五月天

jsp用thin模式連接Oracle數(shù)據(jù)庫

2018-07-20    來源:open-open

容器云強(qiáng)勢上線!快速搭建集群,上萬Linux鏡像隨意使用
<%@ page contentType="text/html;charset=gb2312"%>
<%@ page import="java.sql.*"%>
<html>
    <body>
        <%
            Class.forName("oracle.jdbc.driver.OracleDriver").newInstance();
            String url = "jdbc:oracle:thin:@localhost:1521:orcl";
            //orcl為你的數(shù)據(jù)庫的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()) {
        %>
        您的第一個字段內(nèi)容為:<%=rs.getString(1)%>
        您的第二個字段內(nèi)容為:<%=rs.getString(2)%>
        <%
            }
        %>
        <%
            out.print("數(shù)據(jù)庫操作成功,恭喜你");
        %>
        <%
            rs.close();
            stmt.close();
            conn.close();
        %>
    </body>
</html>

標(biāo)簽: 數(shù)據(jù)庫

版權(quán)申明:本站文章部分自網(wǎng)絡(luò),如有侵權(quán),請聯(lián)系:west999com@outlook.com
特別注意:本站所有轉(zhuǎn)載文章言論不代表本站觀點(diǎn)!
本站所提供的圖片等素材,版權(quán)歸原作者所有,如需使用,請與原作者聯(lián)系。

上一篇:iOS 驗證碼隨機(jī)出現(xiàn)的六位數(shù)

下一篇: 50行Python代碼實現(xiàn)代理服務(wù)器