Eclipse+weblogic+oracle配置WebLogic+eclipse+oracle框架搭建使用说明文档一、安装WebLogic切记weblogic的用户名和密码,在配置部署中会用到。二、安装Oracle数据库三、数据库初始化四、安装MyEclipse前置条件:解压缩eclipse-SDK-3.1.2-win32.zip到指定目录即可。步骤:安装EnterpriseWorkbenchInstaller_4.0.2GA_E3.1.exe安装时目录选择均选择eclipse的解压后目录。破解1.在cmd中,键入javaKeygen得到序列码。2.在菜单MyEclipseUpdateSubscription中键入序列名及序列码。五、在eclipse中配置Hibernate插件Eclipse中加入hibernate插件项目myEclipseaddHibernateCapablities¡,CreatedwithnovaPDFPrinter().Pleaseregistertoremovethismessage.Eclipse+weblogic+oracle配置Next:Next:选择packagsrc默认factory,okCreatedwithnovaPDFPrinter().Pleaseregistertoremovethismessage.Eclipse+weblogic+oracle配置CreatedwithnovaPDFPrinter().Pleaseregistertoremovethismessage.Eclipse+weblogic+oracle配置Hibernate与oracle的连接配置采用JNDI方式配置hibernate.cfg.xml文件.配置文件如下:?xmlversion='1.0'encoding='UTF-8'?!DOCTYPEhibernate-configurationPUBLIC-//Hibernate/HibernateConfigurationDTD3.0//EN!--GeneratedbyMyEclipseHibernateTools.--hibernate-configurationsession-factorypropertyname=connection.datasourcejndi_shebao/propertypropertyname=jndi.urlt3://localhost:7001/propertypropertyname=jndi.classweblogic.jndi.WLInitialContextFactory/propertypropertyname=connection.usernameweb/propertypropertyname=connection.password11111111/propertypropertyname=dialectorg.hibernate.dialect.OracleDialect/propertypropertyname=hibernate.show_sqltrue/propertyWeblogic中配置的JNDI名Weblogic登录帐号,非数据库帐号CreatedwithnovaPDFPrinter().Pleaseregistertoremovethismessage.Eclipse+weblogic+oracle配置mappingresource=com/digitalchina/shebao/modulea/entity/user.hbm.xml//session-factory/hibernate-configuration采用JDBC方式配置hibernate.cfg.xml文件.newDriverDriverLibraries卡new选择oracle数据库驱动classes12.jar点击ok后,自动生成:CreatedwithnovaPDFPrinter().Pleaseregistertoremovethismessage.Eclipse+weblogic+oracle配置至此,hibernate与oracle的连接配置完成!配置文件如下:CreatedwithnovaPDFPrinter().Pleaseregistertoremovethismessage.Eclipse+weblogic+oracle配置?xmlversion='1.0'encoding='UTF-8'?!DOCTYPEhibernate-configurationPUBLIC-//Hibernate/HibernateConfigurationDTD3.0//EN!--GeneratedbyMyEclipseHibernateTools.--hibernate-configurationsession-factorypropertyname=hibernate.show_sqltrue/propertypropertyname=myeclipse.connection.profileoracle/propertypropertyname=connection.urljdbc:oracle:thin:@localhost:1521:IDJ/propertypropertyname=connection.usernamesystem/propertypropertyname=connection.passwordmanager/propertypropertyname=connection.driver_classoracle.jdbc.driver.OracleDriver/propertypropertyname=dialectorg.hibernate.dialect.OracleDialect/propertymappingresource=com/digitalchina/shebao/modulea/entity/user.hbm.xml//session-factory/hibernate-configurationHibernate.cfg.xml文件配置完成!部署hibernate-configuration-3.0.dtd将hibernate-configuration-3.0.dtd文件从hibernate-3.1\src\org\hibernate拷在F:\eclipse\workspace\项目名(项目的根目录下),以及F:\bea\user_projects\domains\项目名(weblogic)下。六、在eclipse中配置Struts插件项目myEclipseaddStrutsCapablities¡,CreatedwithnovaPDFPrinter().Pleaseregistertoremovethismessage.Eclipse+weblogic+oracle配置七、Weblogic数据配置连接池和数据源配置一个新的连接池数据源前置条件成功登录WebLogic控制台,WebLogic的控制台的登录地址为:,其中ip为WebLogicServer的安装机器的IP地址,port为WebLogic对应的端口地址,一般为7001,在本地机器上为,如下图所示:CreatedwithnovaPDFPrinter().Pleaseregistertoremovethismessage.Eclipse+weblogic+oracle配置正确登陆后,出现:第一步:选择ServicesConfigurations-JDBC-ConnectionPools进入配置连接池数据源界面,如下:CreatedwithnovaPDFPrinter().Pleaseregistertoremovethismessage.Eclipse+weblogic+oracle配置点击ConfiganewJDBCConnectionPool¡,进入数据库类型选择页面CreatedwithnovaPDFPrinter().Pleaseregistertoremovethismessage.Eclipse+weblogic+oracle配置选择数据库和驱动类型,点击Continue,进入数据库配置页面其中需要修改的是DatabaseName,为安装过程中的实际的Oracle实例名;HostName为实际的数据库主机名或者IP地址创建并部署数据源点击Createanddeploy,进入成功页面。CreatedwithnovaPDFPrinter().Pleaseregistertoremovethismessage.Eclipse+weblogic+oracle配置如果创建成功,则进入如下页面建立数据源选择ServicesConfigurations-JDBC-DataSourcesCreatedwithnovaPDFPrinter().Pleaseregistertoremovethismessage.Eclipse+weblogic+oracle配置点击ConfigureanewJDBCDataSource在Name栏填入jdbc.ctais,在JNDIName中填入jdbc.ctais,点击continue选择连接池在这里选择刚刚创建的连接池的名称ctais,点击ContinueCreatedwithnovaPDFPrinter().Pleaseregistertoremovethismessage.Eclipse+weblogic+oracle配置进入选择DataSource所在的server点击Create数据源创建成功CreatedwithnovaPDFPrinter().Pleaseregistertoremovethismessage.Eclipse+weblogic+oracle配置八、部署应用包前置条件:将应用包拷贝到BEAHOME/user_projects/domains/mydomain/applications目录下,当然,也可以不拷贝,只是在选择应用时,再选择路径。进入部署页面在WebLogic控制台下,选择Deployments-WebApplicationModules点击¡DeployanewWebApplicationModule¡CreatedwithnovaPDFPrinter().Pleaseregistertoremovethismessage.Eclipse+weblogic+oracle配置选择applications选择sanitation,点击TargetModuleCreatedwithnovaPDFPrinter().Pleasere