was5数据源配置问题

lovettforever 2003-05-12 03:13:18
那位大哥大姐帮帮忙吧
我照红皮书上做不行啊
数据源jndi:QCJNDI
错误如下:
[03-5-12 14:57:47:125 CST] 40150a61 ConnectionFac I J2CA0122I: 无法定位资源引用 QCJNDI,因此使用下列缺省值:[Resource-ref settings]

res-auth: 1 (APPLICATION)
res-isolation-level: 0 (TRANSACTION_NONE)
res-sharing-scope: true (SHAREABLE)
res-resolution-control: 999 (undefined)


什么问题啊?
...全文
57 2 打赏 收藏 转发到动态 举报
写回复
用AI写文章
2 条回复
切换为时间正序
请发表友善的回复…
发表回复
jiangleyang 2003-05-15
  • 打赏
  • 举报
回复
Accessing data using J2EE Connector Architecture connectors

As indicated in the J2EE Connector Architecture (JCA) Specification, each enterprise information system (EIS) needs a resource adapter and a connection factory. This connection factory is then accessed through the following programming model. If you use WebSphere Studio Application Development (WSAD) tools, most of the following deployment descriptors and code are generated for you. This example shows the manual method of accessing an EIS resource.

For each EIS connection, do the following:

Steps for this task

Declare a connection factory resource reference in your application component's deployment descriptors, as described in this example:
<resource-ref>
<description>description</description>
<res-ref-name>eis/myConnection</res-ref-name>
<res-type>javax.resource.cci.ConnectionFactory</res-type>
<res-auth>Application</res-auth>
</resource-ref>

Configure, during deployment, each resource adapter and associated connection factory through the console.
See Configuring J2C resource adapters and Configuring J2C connection factories for more information.
Locate the corresponding connection factory for the EIS resource adapter using Java Naming and Directory Interface (JNDI) lookup in your application component, during run time.
Get the connection to the EIS from the connection factory.
Create an interaction from the Connection object.
Create an InteractionSpec object. Set the function to execute in the InteractionSpec object.
Create a Record instance for the input and output data used by function.
Execute the function through the Interaction object.
Process the record data from the function.
Close the connection.
Usage scenario

The following code segment shows how an application component might create an interaction and execute it on the EIS:

javax.resource.cci.ConnectionFactory connectionFactory = null;
javax.resource.cci.Connection connection = null;
javax.resource.cci.Interaction interaction = null;
javax.resource.cci.InteractionSpec interactionSpec = null;
javax.resource.cci.Record inRec = null;
javax.resource.cci.Record outRec = null;

try {
// Locate the application component and perform a JNDI lookup
javax.naming.InitialContext ctx = new javax.naming.InitialContext();
connectionFactory = (javax.resource.cci.ConnectionFactory)
ctx.lookup("java:comp/env/eis/myConnection");

// create a connection
connection = connectionFactory.getConnection();

// Create Interaction and an InteractionSpec
interaction = connection.createInteraction();
interactionSpec = new InteractionSpec();
interactionSpec.setFunctionName("GET");

// Create input record
inRec = new javax.resource.cci.Record();

// Execute an interaction
interaction.execute(interactionSpec, inRec, outRec);

// Process the output...

} catch (Exception e) {
// Exception Handling
}
finally {
if (interaction != null) {
try {
interaction.close();
}
catch (Exception e) {/* ignore the exception*/}
}
if (connection != null) {
try {
connection.close();
}
catch (Exception e) {/* ignore the exception */}
}
}



--------------------------------------------------------------------------------
jiangleyang 2003-05-15
  • 打赏
  • 举报
回复
was5采用的方式与以前不一样,使用jdk1.3,数据源需要设置jca

2,633

社区成员

发帖
与我相关
我的任务
社区描述
WebSphere 是 IBM 的软件平台。它包含了编写、运行和监视全天候的工业强度的随需应变 Web 应用程序和跨平台、跨产品解决方案所需要的整个中间件基础设施,如服务器、服务和工具。
社区管理员
  • WebSphere社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧