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