首页 | 互联网 | IT动态 | IT培训 | Cisco | Windows | Linux | Java | .Net | Oracle | 软件测试 | C/C++ | 嵌入式开发 | 存储世界 | 服务器
网络设备 | IDC | 安全 | 求职招聘 | 数字网校 | 笔记本电脑 | 北大青鸟 | 技术专题 | 电子书下载 | 教学视频 | 源码下载 | 搜索 | 博客 | 论坛
中国IT实验室Linux频道
中国IT教育
Google
首页 资讯动态 认证考试 新手入门 核心技术 高级技术 J2EE J2ME Java&XML 开源技术 其他技术 RSS订阅 论坛 专题
您现在的位置: 中国IT实验室 >> Java >> J2EE >> J2ee核心 >> 正文

怎么样配置Weblogic的数据源

应用环境:JBuilderX+Welogic7.0+MSSQL server2000

一、    安装MSSQL  Server驱动程序

此处假设安装路径是:F:\green\Microsoft SQL Server 2000 JDBC那么在F:\green\Microsoft SQL Server 2000 JDBC\lib下面, 会有以下三个文件msbase.jar、mssqlserver.jar、msutil.jar。

二、    设置Weblogic的启动classpath,也就是设置Weblogic启动时要加载的包

一定记住:是修改%BEA_HOME%\user_projects\mydomain\目录下的startWeblogic.cmd,一定不要修改%WL_HOME%\server\bin\下的任何文件。

配置后的文件如下:
@rem *************************************************************************
@rem This script is used to start WebLogic Server for the domain in the 
@rem current working directory.  This script simply sets the SERVER_NAME 
@rem variable and calls the startWLS.cmd script under
@rem %WL_HOME%\server\bin.
@rem
@rem To create your own start script for your domain, all you need to set is 
@rem SERVER_NAME, then call %WL_HOME%\server\bin\startWLS.cmd
@rem
@rem Other variables that startWLS takes are:
@rem
@rem WLS_USER     - cleartext user for server startup
@rem WLS_PW       - cleartext password for server startup
@rem STARTMODE    - true for production mode servers, false for 
@rem                development mode
@rem JAVA_OPTIONS - Java command-line options for running the server. (These
@rem                will be tagged on to the end of the JAVA_VM and MEM_ARGS)
@rem JAVA_VM      - The java arg specifying the VM to run.  (i.e. -server, 
@rem                -hotspot, etc.)
@rem MEM_ARGS     - The variable to override the standard memory arguments
@rem                passed to java
@rem
@rem For additional information, refer to the WebLogic Server Administration 
@rem Guide (http://e-docs.bea.com/wls/docs70/adminguide/startstop.html).
@rem *************************************************************************

echo off
SETLOCAL

@rem Set SERVER_NAME to the name of the server you wish to start up.
set SERVER_NAME=myserver

@rem Set WLS_USER equal to your system username and WLS_PW equal  
@rem to your system password for no username and password prompt 
@rem during server startup.  Both are required to bypass the startup
@rem prompt.  This is not recomended for a production environment.

set WLS_USER=zy
set WLS_PW=zy
此处设置后,在启动weblogic时,不需要没次都输入用户名和密码



@rem Set Production Mode.  When this is set to true, the server starts up in 
@rem production mode.  When set to false, the server starts up in development 
@rem mode.  If it is not set, it will default to false.
set STARTMODE=

@rem Set JAVA_OPTIONS to the java flags you want to pass to the vm. i.e.: 
@rem set JAVA_OPTIONS=-Dweblogic.attribute=value -Djava.attribute=value
set JAVA_OPTIONS=-Dweblogic.security.SSL.trustedCAKeyStore=d:\bea\weblogic700\server\lib\cacerts

@rem Set JAVA_VM to the java virtual machine you want to run.  For instance:
@rem set JAVA_VM=-server
set JAVA_VM=

@rem Set MEM_ARGS to the memory args you want to pass to java.  For instance:
@rem set MEM_ARGS=-Xms32m -Xmx200m
set MEM_ARGS=


set  classpath=%WL_HOME%\common\lib\classes12.jar;%WL_HOME%\common\lib\mssqlserver.jar;%WL_HOME%\common\lib\msbase.jar;%WL_HOME%\common\lib\msutil.jar 
此处的设置根据自己的情况来确定




@rem Call Weblogic Server
call "d:\bea\weblogic700\server\bin\startWLS.cmd"

ENDLOCAL

三、    在Weblocig的控制台中设置连接池和数据源,略

总结
   配置过程最重要的是第二步,因为如果classpath配置错误,那么在配置数据源的时候将会找不到驱动程序类

如果还有问题和我联系 zhyiwww@163.com
【责编:Peng】

中国IT教育

相关产品和培训
文章评论
 友情推荐链接
 认证培训
 专题推荐

 ·算法分析与设计之五大常用算法
 ·开发必备 漫谈Java加密保护
 ·嵌入式开发--ARM技术专题
 ·C/C++指针,认真了解,灵活运用
 ·.NET开发:C#实用基础教程
 ·软件测试工具QTP学习专题
 ·嵌入式开发单片机解决方案专题
 ·Java开发环境 Greenfoot 程序员手册
 ·C++对象布局及多态实现的探索
 ·常见排序算法的实现
 今日更新
 社区讨论
 博客论点
 频道精选
 Java 频道导航