weblogic数据源配置与使用方法_第1页
weblogic数据源配置与使用方法_第2页
weblogic数据源配置与使用方法_第3页
weblogic数据源配置与使用方法_第4页
weblogic数据源配置与使用方法_第5页
已阅读5页,还剩5页未读 继续免费阅读

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

1、Weblogic配置使用数据源 与使用方法我用的WeblogiclO,其他可能有点不同,不过应该差不多启动weblogiclO,登录选择 JDBC- Data Sources ,如图 1图1进入界面后,先点击左上角的Lock&Edit按钮,如图2Chdrwjv Cvritirj WdconH*, wubkiglc 10iaw mamm jnd昶 3r is匚IM the Lod( S Edit button to modifr, jcklor dele怕 rlEnte n 如ts dOEnan,Lock出购Donutn SlructiirezhHoman*: &wmonmert eployme

2、n 惊 盲 SftVlCM s&cuny Reahnsgoper 即 Diaosg-time a buiiniury bf JDBIZ Ddtd buurieSummary of BHC D.ta Socrcca sec dta suto 百 * ab)t lumd to 2 mi Mr gvg d g对 血*第 cn (he joi tree and Wi tarow 白为逊a ocrmection ftThs page summa-ises the X)BC data gree obpcls that have been cr卜CwtecniCT粧憎就耳DJt JND1 Name:what

3、 datable t/pe waiJd you Ite to setecr?Odt的& TypeiPaiij日建“Wkiatdatbsse drver vvoud you lie to use to 仃unne database ccnnectrors?Database Oiver:| T(jintBase*s Driver (Typ& 4 XAJ Versions:4.X,5.i9ebl|4uo LKK)dc wp * 眄吃SMAuer a M4cM1Ml j drii炉uinMOCffUO 3QI4JWJUTD UWfdOt 皿 f A|U0 LCl)dO )WS Wlf&JM如MHjM回

4、魁旳*d 逊trza 6 dwevm U 机却 3MW mot 碾gf 旺輕曲世mutoh闿 j-iFi bu|btai訝ujuiq MLhKMi wwj 理 *9nd u 呻曲期QMd gm mwu4 (mtO w*ti wi MQ&ai m Euviuh*warqqu 测如zd qqi tvmmp zuo* cwgM 加工哄3事廣调口 bumno4j uwtomainies却机 EE gpMldi冲 /njosWp 制5 q aoatfXKl wqjiewejb em ewoLpeseeyd 超 j csuoqEujsije,jQ |eqci|i tJOckT5 njnot 日ep 引绅

5、saoai&rtrt tfirp #Ju *6* utaXwR创Eji 科 *屈 墟垛XM 1*飢| iOaunqiln (iBiii-mFii3MW5 曰7 Ifitr Mdh它 刊更陶Create a New JDBC Data SourceBack New, 11 FTi力 IConnection PropertiesDefine Connection Properties.What is the rame of database you would liks to connect to?Database Name:sshWhat is the name or IP address of

6、 the database server?Host Name:127,0.0.1Whmt is the pert on tie database server used to con nett to the database?Port:3306Whmt database account user name do you want to use to create database ccnnections?Database User Name:rootWhat is the database account password to use bo create database connectio

7、ns?Sack Next| Cancel图6参数解释:Database Name:数据库名Host Name:数据库地址,我是本地所以是127.0.0.1Port:数据库端口, mysql默认端口是3306,其他数据库各有不同Database User Name数据库用户名Password/Confirm Password :数据库密码配置好了点 next然后点击上面的 Test Configeration如图7Create a New JDBC Data SourceTest ConfiguratianBack:NextFinishCancel点击第二个选项卡,即Targets,出现如图11

8、Test Database Conn&c donTest ttie database availability and the connection properties you provided.图7PS:测试成功通过就点Fi ni sh,测试要是没通过自己找原因,有的时候会是驱动的问题,如果是找不到驱动错误的话,就自己把驱动放到 weblogic里去,在weblogic8.1中就有可能出现这种问题,数据库驱动放在你电脑weblogic安装的位置beawlserver_10.0serverlib这时候还没有Targets,还不能用,点击MysqlTest,也就是Finish 如图 8niam

9、e gmoi MameTargetsI flnysqlTI_my3qlAdmhfeverNOlTeitMYsqrrest其中MysqlTest是刚才新建的数据源刚才创建的数据源,出现图 9页面Settincfr fvr rysqllet|T3TQels |MpnrtiylngOonfrolSecirityMotesConfigurationQmecbai PoolTransactionDagnosticg Identity OptionsAppleJtJtns a database ccmectiori from d dau source look hg Lp the 廿2苗 sotriie

10、ort the 伽a M, snd then requesthg a comectiori The data 罠im provides the onnection to the- appl iction frDrrr ib pThis page enable百 you to define genera I conflguratm options for tfils JDBC daxa saxmMfsqlT estA uikfj? name that ider iorm More Into.-图10Settings for MysqlTest匚口口 flgurmticn Targets Moni

11、toring CctiItdI Security NotesThis allows you to seled ihe servers or clusters qh which you would like 忙 deplo图11选择Server,然后点Save”,然后点左上角的 Activate Changes.如图12位置图12然后数据源就可以用了测试数据源连接1随便建一个web工程2.在页面里写如下代码如图13InitialConteJCt context = new IilitialConteMt ();DataSource ds = (DataSource) context. lookup (lfJNDl_ntiysqlr,); Connect ion conn = da - getCoiinect ion ();Statement stm = connere ate Stat eincnt-();StrinEuffer sb = newfer();slo + append (rrse l&ct * fuem us&r_talo le,r);ResultSet rs atm,

温馨提示

  • 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
  • 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

评论

0/150

提交评论