本篇文章為大家展示了如何讀取java項目中的jdbc.properties文件,內(nèi)容簡明扼要并且容易理解,絕對能使你眼前一亮,通過這篇文章的詳細(xì)介紹希望你能有所收獲。
java內(nèi)容
Properties props = Resources.getResourceAsProperties("jdbc.properties"); String url = props.getProperty("jdbc.url"); String driver = props.getProperty("jdbc.driverClass"); String username = props.getProperty("jdbc.username"); String password = props.getProperty("jdbc.password"); Class.forName(driver).newInstance(); Connection conn = (Connection) DriverManager.getConnection(url, username, password);
文章名稱:如何讀取java項目中的jdbc.properties文件-創(chuàng)新互聯(lián)
轉(zhuǎn)載注明:http://jinyejixie.com/article6/dsheog.html
成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供網(wǎng)站收錄、網(wǎng)站維護、網(wǎng)站導(dǎo)航、網(wǎng)站排名、營銷型網(wǎng)站建設(shè)、定制網(wǎng)站
聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請盡快告知,我們將會在第一時間刪除。文章觀點不代表本網(wǎng)站立場,如需處理請聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時需注明來源: 創(chuàng)新互聯(lián)
猜你還喜歡下面的內(nèi)容