WebLogic Connection database configuration, WebLogic connection configuration steps

Source: Internet
Author: User

 

WebLogic Connection database configuration, WebLogic connection configuration steps

 

 

1. Start Bea
Open Console: Open http: // 172.18.426222: 7001/console in the browser to start the console. Enter Administrator

Username and password (default: WebLogic/WebLogic ).

Create a JDBC Data source:

In the "Domain Structure" tree, expand "service"> "JDBC" and select "Data Source ".

On the "Data Source overview" page, click "new ".

On the "JDBC data source properties" Page, enter or select the following information:

Name: JDBC/Oracle

JNDI name: JDBC/Oracle

Database Type: Oracle

Database driver: BEA Oracle driver type 4 Version ......

Click "Next ".

You do not need to change the default value, and then click "Next ".

Enter the following values:

Database Name: o9i (enter the ID of the Oracle database instance, that is, Sid)

Host Name: 127.0.0.1 (Database Server IP address or hostname)

Port 1521

Database username: ** password: Tiger

Confirm Password: Tiger

Click "Next ".

Click "test configuration. If "connection test succeeded" is displayed, the preceding parameters are correctly configured. Click "Next.

In the "select target" operation, select the servers on which the data source needs to be deployed, select "adminserver", and click "finish ".

"Button.

Click "Activate change" to save the configuration information permanently and take effect.

The JNDI data source has been created and deployed successfully.

Restart Bea

II,

Context initcontext = new initialcontext ();
// Context envcontext = (context) initcontext. Lookup ("Java:/COMP/ENV ");

Javax. SQL. datasource DS = (javax. SQL. datasource) (initcontext). Lookup ("**"); // obtain the number of settings

Data Source

Connection conn = NULL;

Conn = Ds. getconnection ();

Return conn;
 

At this point, it is OK. As long as a Conn is returned, the operation can be performed.

 

For more information on WebLogic management and configuration, see the author csdn resources "WebLogic management guide Chinese edition": http://download.csdn.net/source/1223061

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.