GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | ||||||||||||||||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | ||||||||||||||||||||||||||||
GeezerVison is showing docs.oracle.com — 4 Using the Default Data Source
7/28
4 Using the Default Data SourceThis chapter provides information on how to use the default data source. This chapter includes the following sections: What is the Default Data SourceOracle provides a default data source required by a Java EE 7-compliant runtime. This preconfigured data source can be used by an application to access the Derby Database installed with WebLogic Server. It is accessible under the JNDI name: java:comp/DefaultDataSource which is equivalent to: @Resource(lookup="java:comp/DefaultDataSource") DataSource myDS; You can explicitly bind a DataSource resource reference to the default data source using the lookup element of the Resource annotation or the lookup-name element of the resource-ref deployment descriptor element. Note: The Derby database is started by thestartWebLogic command by default. For more information on starting and stopping a WebLogic Server instance, see "Starting and Stopping Servers" in Administering Server Startup and Shutdown for Oracle WebLogic Server.Characteristics of a Default Data SourceA default data source has the following characteristics:
The WebLogic Server Default Data Source DefinitionThe following table provides the configuration settings that define the WebLogic Server default data source definition: Table 4-1 Default Data Source Configuration
Defining a Custom Default Data SourceYou can use the pre-configured default data source or you can implement a custom default data source. To implement a custom default data source, use one of the following methods:
After the component is deployed, if Creating a Custom Default Data Source DescriptorYou can configure a data source descriptor that is bound to @Stateless(mappedName="DSBean") @DataSourceDefinition(name="java:comp/DefaultDataSource", className="oracle.jdbc.OracleDriver", portNumber=1521, serverName="myServer", databaseName="myDB", user="a username", password="a password", transactional=false ) public class DSBean implements DSInterface . . . Overriding the Default Data SourceYou can override the preconfigured default data source provided by WebLogic Server by updating the JNDI name in the Default Data Source attribute in the configuration of a server or server template to point to another existing data source. See the following topics in Administering Oracle WebLogic Server with Fusion Middleware Control: In a partitioned environment, you can override this attribute using the Compatibility Limitations When Using a Default Data SourceIn releases prior to Weblogic Server 12.2.1, WebLogic Server tries to satisfy unresolved data source | ||||||||||||||||||||||||||||
| You are visitor 01402605 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |