宁国都颈装饰工程有限公司

單項(xiàng)選擇題

在Java Web應(yīng)用程序中,下列()選項(xiàng)中的代碼能夠正確實(shí)現(xiàn)使用數(shù)據(jù)源(DataSource)獲取數(shù)據(jù)庫(kù)連接對(duì)象(數(shù)據(jù)源名稱(chēng)為dsname)。

A. DataSource soure = new DataSource( ) ; Connection conn = source.getConnection( );
B. Context source = new InitalContext( ); Connection conn = source.getConnection( );
C. Context ctx = new InitalContext( ); DataSource ds = (DataSource) ctx.lookup("java:comp/env/dsname"); Connection conn =ds.getConnection( );
D. Context ctx = new InitalContext ( ); DataSource ds = (DataSource) ctx.lookup("dsname"); Connection conn = ds.getConnection( );

微信掃碼免費(fèi)搜題
鹿邑县| 博爱县| 葫芦岛市| 虎林市| 庐江县| 樟树市| 赣榆县| 襄城县| 长兴县| 桦甸市| 吉林市| 时尚| 泸水县| 宜宾市| 长兴县| 于都县| 凤阳县| 桐梓县| 襄垣县| 攀枝花市| 峡江县| 拉萨市| 河津市| 弥勒县| 卢湾区| 玉林市| 尼勒克县| 黎城县| 保德县| 古田县| 深圳市| 华坪县| 宜君县| 西充县| 株洲县| 个旧市| 光山县| 临泉县| 桂平市| 铜山县| 恩平市|