OC4J或Oracle Application Server 下MSSQLServer数据源的配置

转自http://www.suneca.com

昨天帮一个朋友解决一个应用系统的发布问题,他们的应用系统必须发布在Oracle Application Server下,原先开的用的Servlet容器是使用Tomcat,现在需要将应用系统移植到OAS上面。由于OAS比较大,所以我们使用了OAS的核心容器OC4J,直接使用OC4J对资源的损耗,也少很多。

因为一直使用Oracle数据库,还真的没在OC4J上面使用连接池连接到达MSSQLServer,所以搞了一两个小时,居然搞定定,实在是丢脸,也觉得很不好意思。昨天晚上回到家之后,继续研究这一块的实现,终于搞定了如何在OC4J上面配置MSSQLServer的连接池,这种配置方式Mysql一样可行。

OC4J的EM控制台做得比较专制,而这个管理后台只支持Oracle的连接池跟数据源的配置,晕死!如果想采用其他的数据库,那只能通过手工修改配置文件的方式来实现了,再次晕死。。。。

首先介绍一下网上网友的实现方案:

第一步:将MSSQLServer的jdbc driver拷贝到%OC4J_HOME%/j2ee/home/applib,对于OC4J或OAS都是一样,应用程序的包文件,可以放在这个目录下,OAS或OC4J会自动加载。

第二步:修改%OC4J_HOME%/j2ee/home/conf/data-sources.xml,在XML当中,增加以下配置:

code.gif 程序代码

class="com.evermind.sql.DriverManagerDataSource"

name="JIRA database"

location="jdbc/sunecaDataSource"

xa-location="jdbc/xa/sunecaDataSource"

pooled-location="jdbc/sunecaDataSource"

connection-driver="net.sourceforge.jtds.jdbc.Driver"

username="suneca"

password="www.suneca.com"

url="jdbc:jtds:sqlserver://localhost/suneca;tds=8.0;lastupdatecount=true"

inactivity-timeout="30"

/>

使用上面的方式怎么配置都起不来。。。晕死。。。我测试使用了MSSQLServer官方的driver跟jtds都不行(上面的配置是使用jtds的,如果是官方driver,无非就是url跟driver不同而已)!居然网上类似的贴还真是多。。。真是天下文章一大抄,哈哈~~~

后来研究了一下,根据一些OAS的DEMO,使用以下例子终于可以实现,以下例子是使用Microsoft官方Driver。

修改一下data-sources.xml文件,在该文件当中增加以下的配置信息:

code.gif 程序代码

name="SQLSERVERDS"

max-connections="30">

user="suneca"

password="www.suneca.com"

url="jdbc:microsoft:sqlserver://127.0.0.1:1433;DatabaseName=suneca;SelectMethod=Cursor"

commit-record-table-name=""/>

connection-pool-name="SQLSERVERDS"

jndi-name="jdbc/sunecaDataSource"

name="SunecaDataSource"/>

终于可以连接上去了。。。感动中。。。

希望这编文章对有这一方面需要的朋友有所帮助!

顺便将web.xml的配置也一起贴上来:

code.gif 程序代码

...

DB Connection

jdbc/sunecaDataSource

javax.sql.DataSource

Container

...

数据源的引用

code.gif 程序代码

...

Context context = new InitialContext();

DataSource ds = (DataSource)context.lookup("jdbc/sunecaDataSource");

Connection conn = ds.getConnection();

[@more@]

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/22403494/viewspace-1030460/,如需转载,请注明出处,否则将追究法律责任。

转载于:http://blog.itpub.net/22403494/viewspace-1030460/

Oracle Application Server 10g 管理手册 Oracle Application Server 10g 管理手册, 立即下载

相关推荐

手动添加MSSQL数据源程序

根据你填入的数据源参数,自动添加数据源。

oc4j-2

十一、怎样启动OC4J独立版? 启动OC4J服务器,首先要用DOS命令切换到J2EE_HOME目录,然后: a)根据j2ee/home/config目录下的默认配置文件启动OC4J: > cd <J2EE_HOME> &g...

weixin_33815613的博客 263

深空探测处理软件USGS-ISIS的下载安装

深空探测处理软件USGS-ISIS下载安装教程

qq_31721595的博客 3313

配置MSSQL数据源连接步骤:

配置MSSQL数据源连接步骤:[很卡,设置下了分辨率了]1.打开MSSQL  ,首先确定你这MSSQL是否为启动状态,从这看,应该是没有启动的   那好,现在启动SQL  好,现在已经启动2.配置数据源 开始->控制面版->性能和维护(如果是在经典视图下则不用此步)->管理工具->数据源 (ODBC)->系统 DSN->添加->(现在可以 看到,在此可以连接很多数据库)选择最后一个->完成->

1024

【pprof】简要学习教程

基本介绍 pprof 是在做性能优化前的性能分析工具。 安装: go get -u github.com/google/pprof 分析工具 go tool pprof 是命令行指令,用于分析 Profiling 数据,源数据可以是 http 地址,也可以是已经 dump 下当 profile 文件;查看模式可以命令行交互模式,也可以是浏览器模式(-http 参数)。 两种应用 服务型应用 _ "net/http/pprof" 包,专用于采集 web 服务 运行数据的分析。即在运行的服务中通过 API .

码农印象 885

海思ISP调优实战:从实验室到真实场景的IPC相机图像质量优化指南

本文深入探讨海思ISP调优在IPC相机图像质量优化中的实战应用,从实验室标定到真实场景部署的全链路调优方法。重点解决光照动态范围、色温变化和噪声特性等核心问题,提供AE权重表配置、CCM标定、3DNR时域滤波等关键技术方案,帮助实现从理论到实践的图像质量提升。

s3t4u的博客 750

OC4J或Oracle Application Server 下MSSQLServer数据源的配置

       昨天帮一个朋友解决一个应用系统的发布问题,他们的应用系统必须发布在Oracle Application Server下,原先开的用的Servlet容器是使用Tomcat,现在需要将应用系统移植到OAS上面。由于OAS比较大,所以我们使用了OAS的核心容器OC4J,直接使用OC4J对资源的损耗,也少很多。    因为一直使用Oracle数据库,还真的没在OC4J上面使用连接

软件工程 plus 人工智能 1258

汽车底盘技术解析:从悬架调校到智能化,如何评价国产车底盘实力

汽车底盘作为决定车辆驾驶质感、安全性和耐久性的核心系统,其技术内涵远不止于悬架结构。从行驶系、转向系到制动系的协同工作,底盘调校是一门融合机械原理与工程实践的艺术。在电动化与智能化浪潮下,底盘技术正经历从被动适应到主动响应的变革,CDC可变阻尼减震器和空气悬架等技术的应用,让底盘具备了通过OTA升级实现性能优化的可能。国产汽车品牌如奇瑞、吉利等,通过平台化架构研发与调校经验积累,正推动底盘技术从“能用”向“好用”乃至“塑造独特驾驶风格”迈进。理解底盘技术,需超越简单的结构对比,关注其在实际路况中的滤震性、支

weixin_34413103的博客 387

win10操作系统的ODBC数据源配置sqlserver数据库

ODBC数据源全称是开放数据库互连(Open Database Connectivity),在微软公司开放的数据库结构中的一部分,其实就是一个应用程序的接口,主要用于提供数据库的编写应用程序的能力。 简单说就是ODBC一个中间层,我们自己开发的软件连上他,他连上数据源(也就是数据库)。这个数据库是access,还是sql server的,或者是oracle的,只要在odbc里设置就行了。这样odbc

cuiyaoqiang的博客 5万+

Windows 下安装 Hermes Agent 完整教程(含踩坑记录)

不支持原生 Windows,必须通过 WSL2 (Windows Subsystem for Linux 2) 运行。WSL2 是 Windows 内置的 Linux 兼容层,可以在 Windows 上运行完整的 Linux 环境。

weixin_50191542的博客 4280

opencv 常用函数总结

本文是一份OpenCV图像处理的常用函数总结,详细介绍了图像的读入、显示、保存、像素处理、图像属性获取、基础操作、阈值处理、图像平滑、形态学转换以及直方图处理等关键技术。文章通过代码示例和参数说明,帮助读者快速掌握OpenCV在图像处理领域的应用。

weixin_44063529的博客 1600

oracle数据库配置管理,Oracle配置管理

一、连接Oracle1、Oracle建立连接的过程无论是通过sqlplus命令连接还是第三方工具远程连接到Oracle,都需要建立客户端与服务端之间的连接。Oracle Net Service组件就是为了用于建立连接的,这个组件在安装Oracle时已经安装。1)在服务器端有一个listener监听器,监听着来自客户端的连接请求2)在客户端输入用户名、口令、网络服务名以发送连接请求3)客户端查看本地...

weixin_30467861的博客 306

气体放电管GDT选型解析

气体放电管(GDT)是电子设备电磁兼容设计中应对浪涌防护的核心器件,具有高能量吸收能力(10kA以上)和低漏电流特性。其工作原理分为击穿、导通和熄弧三阶段,通过电离气体泄放浪涌能量。GDT适用于雷击等大能量防护,但响应较慢(0.1-0.3μs),需搭配TVS/MOV组成多级防护。选型需匹配击穿电压(如220VAC系统选800V型号),并注意续流风险。典型应用包括电源端口、通信防雷模块的三极管共模防护或GDT-MOV串联方案,实现能量分流与快速钳位平衡。

硬核科技 209

oracle application server

OAS的问题解决 某一天发现网站和后台都无法登陆,重启服务器后,ias后台能进入,但是发现ias后台的几个服务无法正常启动导致外网网站无法正常启动。 异常如下图: 再次选中以上的几个服务启动服务,发现home和CXSERVER无法启动错误提示为无法正常启动,已经超过重试限制,查看日志信息发现提示的error信息是关于servlet的...

weixin_33859844的博客 334

把 LangGraph 当“工作流引擎”用:与传统 BPM 的差异与融合策略

首先,我们来回顾一下有限状态机(FSM)的基本定义——一个 FSM 可以用一个五元组MQΣδq0FMQΣδq0​FQQQ有限状态集合,包含 FSM 所有可能的状态;Σ\SigmaΣ有限输入字母表,包含 FSM 所有可能的输入;δ\deltaδ状态转移函数,定义了 FSM 从当前状态q∈Qq \in Qq∈Q接收输入σ∈Σσ∈Σ后,转移到的下一个状态q′∈Qq' \in Qq′∈Q,即δQ×Σ→QδQ×Σ→Q。

AI 原生应用开发的博客 227

Data-Structures-and-Algorithm-Analysis-in-Java.pdf

作者: Weiss, Mark A. 出版社: Addison Wesley Data Structures and Algorithm Analysis in Java is an “advanced algorithms” book that fits between traditional CS2 and Algorithms Analysis courses. In the old ACM Curriculum Guidelines, this course was known as CS7. This text is for readers who want to learn good programming and algorithm analysis skills simultaneously so that they can develop such programs with the maximum amo...

在spring中application.properties 配置 sql 数据源

原创于 【模棱博客】 在spring中application.properties 配置 sql 数据源以下翻译为Spring官网 https://docs.spring.io/spring-boot/docs/1.5.8.RELEASE/reference/htmlsingle/#boot-features-configure-datasource # data source ( dat...

【模棱博客】 – Java技术博客 4452

复分析 阿尔福斯(Ahlfors) 第三版答案 英文

答案分为十章,有部分习题没有答案,全英文复分析阿尔福斯(Ahlfors) 第三版答案

oracle秒级更新,oracle ebs database升级11.1.0.7到11.2.04

7 升级Oracle数据库到11gR27.1 先打补丁7303030_zhs,9062910,8919489,8919489_ZHS ,9868229,10163753,11071569,9738085,9852070,12686610(貌似批量打补丁时查询麻烦,所以不用AD Merge Patch)停应用:su – appltest. /u01/TEST/apps/apps_st/appl/AP...

weixin_36118752的博客 646

深度学习工具包 DeepLearningToolbox

深度学习工具包Deprecation notice.-----This toolbox is outdated and no longer maintained.There are much better tools available for deep learning than this toolbox, e.g. [Theano](http://deeplearning.net/software/theano/), [torch](http://torch.ch/) or [tensorflow](http://www.tensorflow.org/)I would suggest you use one of the tools mentioned above rather than use this toolbox.Best, Rasmus.DeepLearnToolbox================A Matlab toolbox for Deep Learning.Deep Learning is a new subfield of machine learning that focuses on learning deep hierarchical models of data.It is inspired by the human brain's apparent deep (layered, hierarchical) architecture.A good overview of the theory of Deep Learning theory is[Learning Deep Architectures for AI](http://www.iro.umontreal.ca/~bengioy/papers/ftml_book.pdf)For a more informal introduction, see the following videos by Geoffrey Hinton and Andrew Ng.* [The Next Generation of Neural Networks](http://www.youtube.com/watch?v=AyzOUbkUf3M) (Hinton, 2007)* [Recent Developments in Deep Learning](http://www.youtube.com/watch?v=VdIURAu1-aU) (Hinton, 2010)* [Unsupervised Feature Learning and Deep Learning](http://www.youtube.com/watch?v=ZmNOAtZIgIk) (Ng, 2011)If you use this toolbox in your research please cite [Prediction as a candidate for learning deep hierarchical models of data](http://www2.imm.dtu.dk/pubdb/views/publication_details.php?id=6284)```@MASTERSTHESIS\{IMM2012-06284, author = "R. B. Palm", title = "Prediction as a candidate for learning deep hierarchical models of data", year = "2012",}```Contact: rasmusbergpalm at gmail dot comDirectories included in the toolbox-----------------------------------`NN/` - A library for Feedforward Backpropagation Neural Networks`CNN/` - A library for Convolutional Neural Networks`DBN/` - A library for Deep Belief Networks`SAE/` - A library for Stacked Auto-Encoders`CAE/` - A library for Convolutional Auto-Encoders`util/` - Utility functions used by the libraries`data/` - Data used by the examples`tests/` - unit tests to verify toolbox is workingFor references on each library check REFS.mdSetup-----1. Download.2. addpath(genpath('DeepLearnToolbox'));Example: Deep Belief Network---------------------```matlabfunction test_example_DBNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit RBM and visualize its weightsrand('state',0)dbn.sizes = [100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);figure; visualize(dbn.rbm{1}.W'); % Visualize the RBM weights%% ex2 train a 100-100 hidden unit DBN and use its weights to initialize a NNrand('state',0)%train dbndbn.sizes = [100 100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);%unfold dbn to nnnn = dbnunfoldtonn(dbn, 10);nn.activation_function = 'sigm';%train nnopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.10, 'Too big error');```Example: Stacked Auto-Encoders---------------------```matlabfunction test_example_SAEload mnist_uint8;train_x = double(train_x)/255;test_x = double(test_x)/255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit SDAE and use it to initialize a FFNN% Setup and train a stacked denoising autoencoder (SDAE)rand('state',0)sae = saesetup([784 100]);sae.ae{1}.activation_function = 'sigm';sae.ae{1}.learningRate = 1;sae.ae{1}.inputZeroMaskedFraction = 0.5;opts.numepochs = 1;opts.batchsize = 100;sae = saetrain(sae, train_x, opts);visualize(sae.ae{1}.W{1}(:,2:end)')% Use the SDAE to initialize a FFNNnn = nnsetup([784 100 10]);nn.activation_function = 'sigm';nn.learningRate = 1;nn.W{1} = sae.ae{1}.W{1};% Train the FFNNopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.16, 'Too big error');```Example: Convolutional Neural Nets---------------------```matlabfunction test_example_CNNload mnist_uint8;train_x = double(reshape(train_x',28,28,60000))/255;test_x = double(reshape(test_x',28,28,10000))/255;train_y = double(train_y');test_y = double(test_y');%% ex1 Train a 6c-2s-12c-2s Convolutional neural network %will run 1 epoch in about 200 second and get around 11% error. %With 100 epochs you'll get around 1.2% errorrand('state',0)cnn.layers = { struct('type', 'i') %input layer struct('type', 'c', 'outputmaps', 6, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %sub sampling layer struct('type', 'c', 'outputmaps', 12, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %subsampling layer};cnn = cnnsetup(cnn, train_x, train_y);opts.alpha = 1;opts.batchsize = 50;opts.numepochs = 1;cnn = cnntrain(cnn, train_x, train_y, opts);[er, bad] = cnntest(cnn, test_x, test_y);%plot mean squared errorfigure; plot(cnn.rL);assert(er<0.12, 'Too big error');```Example: Neural Networks---------------------```matlabfunction test_example_NNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);% normalize[train_x, mu, sigma] = zscore(train_x);test_x = normalize(test_x, mu, sigma);%% ex1 vanilla neural netrand('state',0)nn = nnsetup([784 100 10]);opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samples[nn, L] = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.08, 'Too big error');%% ex2 neural net with L2 weight decayrand('state',0)nn = nnsetup([784 100 10]);nn.weightPenaltyL2 = 1e-4; % L2 weight decayopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex3 neural net with dropoutrand('state',0)nn = nnsetup([784 100 10]);nn.dropoutFraction = 0.5; % Dropout fraction opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex4 neural net with sigmoid activation functionrand('state',0)nn = nnsetup([784 100 10]);nn.activation_function = 'sigm'; % Sigmoid activation functionnn.learningRate = 1; % Sigm require a lower learning rateopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex5 plotting functionalityrand('state',0)nn = nnsetup([784 20 10]);opts.numepochs = 5; % Number of full sweeps through datann.output = 'softmax'; % use softmax outputopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex6 neural net with sigmoid activation and plotting of validation and training error% split training data into training and validation datavx = train_x(1:10000,:);tx = train_x(10001:end,:);vy = train_y(1:10000,:);ty = train_y(10001:end,:);rand('state',0)nn = nnsetup([784 20 10]); nn.output = 'softmax'; % use softmax outputopts.numepochs = 5; % Number of full sweeps through dataopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, tx, ty, opts, vx, vy); % nntrain takes validation set as last two arguments (optionally)[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');```[![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/rasmusbergpalm/deeplearntoolbox/trend.png)](https://bitdeli.com/free "Bitdeli Badge")

jre9下载 jdk9

(Java SE Runtime Environment 9.0) 9.0u175 官方最新版 【x86|x64】

oracle oc4j配置

oracle数据库安装成功后在目录F:\app\song.peng\product\11.1.0\db_1\下有一个ocj文件夹,这个就是oc4j1、修改F:\app\song.peng\product\11.1.0\db_1\oc4j\j2ee\home\config目录下的server.xml文件配置jdk路径,启动编码等。&lt;java-compiler name="javac" in-p...

蓝色飞扬 860

在OC4J下配置JMS & 使用Message-Driven Bean

本文转载自:http://harper.ycool.com/post.1021639.html   本文涉及的背景知识如下:   1. JNDI (Java Naming and Directory Service )   2.    JMS (Reference: Java Message Service O’Reilly, Jan 2001 First Ed.)   3.    EJ...

蓝色飞扬 212

在与 SQL Server 建立连接时出现与网络相关的或特定于实例的错误。未找到或无法访问服 务器。请验证实例名称是否正确并且 SQL Server 已配置为允...

可怜的我啊,搞了一个下午,连接 C#连接Sql server2005,就是连接不上, 然后查资料啊查资料,不仅抱怨国内的文章千篇一律,都没讲清楚到底怎样去写 怎样去配置,你转载我,我转载你。当然,我也喜欢转载。。。。,哈哈哈哈 遇到的问题,就是连接不上Sql server2005, 提出的错误是:   在与 SQL Server 建立连接时出现与网络相关的或特定于实例的错误。未找...

Hi, Sun 670

mysql数据源配置

mysql数据源配置 1.进入 http://localhost:8080/admin/conf文件夹下的tomcat-users.xml   有管理员的用户名密码等信息。   选择Resources-Data sources进入配置数据源界面,选择   Data Source Actions ->选择Create New Data Source,进入配置详细信息界面,   内容如下:    

laiahu的专栏 1万+

jndi调用时,各种应用服务器InitialContext的写法

调用ejb时,如果客户端和ejb不在同一个jvm,就要设置InitialContext,不同的应用服务器InitialContext写法也不同. Context.INITIAL_CONTEXT_FACTORY:指定到目录服务的连接工厂 Context.PROVIDER_URL:目录服务提供者URL //jboss: Context.INITIAL_CONTEXT_FACTORY, "o...

小嘴冰凉 386

Oracle9iAS Containers for J2EE独立版指南--(OC4J数据源配置、调用 与 RMI)

 OC4J配置的数据源,如果被OC4J自己内部运行的程序调用没有问题如:oc4j903/j2ee/home/config/data-sources.xml中在到之间添加           password="assgis"            username="portal"            url="jdbc:oracle:thin:@172.18.2.6:1521:apps"   

黄为的专栏 2085
上一篇: 常用网络小命令
下一篇: UNIX常用命令
cuixie8137
博客等级 码龄10年 0粉丝 0原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符  | 博主筛选后可见
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值