The journey of EJB Technology (II.)

Source: Internet
Author: User
Tags connection pooling microsoft website

An in-depth analysis of design examples

Requirements:

This paper assumes that the reader is familiar with the EJB technology and has a certain understanding of SQL. Because EJB involves a lot of technology, although each time only tells a technology, but the various technology is related, therefore wants the reader to understand, because this is not very good organization.

Instance background

Database: SQL Server 2000

Operating system: Windows 2000

Development tools: JBuilder 7

EJB Server: WebLogic 7.0

Machine IP Address, 10.11.12.58

Example: through stateless session beans get the data of entity beans of container management, and then give the data of the stateless session beans to the JSP page, so that the customer can see the result. This process allows you to know how easy it is to write an EJB component.

Preparatory work

Configure the JDBC driver for SQL Server 2000 (Microsoft website is available for download, or it can be provided with Bea!). This example uses Microsoft JDBC), JBuilder 7 + WebLogic 7, and others.

Development process

1. To configure a JDBC data source: This process consists of two steps, first configuring the connection pool (Connection pools). (Why connection pooling: Developers do not want to write database code, replace the system becomes simple, limit the number of connections to the database, do not need to establish a new connection for each customer.) The concept of this pool appears in many places in Java EE, such as the EJB itself, with the following parameters:

Name:cacd

URL:JDBC:MICROSOFT:SQLSERVER://10.11.12.58:1433;USER=SA;PASSWORD=CACD;

Driver ClassName:com.microsoft.jdbc.sqlserver.SQLServerDriver

Initial Capacity:3

Maximum capacity:10

Second, the JDBC data source is configured with the following parameters configured in TX Data sources:

Name:cacd

JNDI NAME:CACD

Pool NAME:CACD (to match the front!) )

What is the difference between the Tx data Sources and the general data Sources? Read to the reader to think and discuss. )

Where, in the URL, you need to configure a username SA for SQL Server 2000, the password is CACD, because it uses type 4 JDBC, so you need to modify SQL Server 2000 's user authentication to: Nt+sql Server 2000 hybrid authentication.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.