November 2024
M T W T F S S
 123
45678910
11121314151617
18192021222324
252627282930  

Categories

November 2024
M T W T F S S
 123
45678910
11121314151617
18192021222324
252627282930  

Setup an Oracle JDBC Data Source on WebSphere Application Server 7 Step-by-Step

Login to the Admin Console of the running server, i.e. Window -> Show Views -> Servers | right click the server -> Run Administration -> Run Administrative Console

Environment -> WebSphere variables

Find “ORACLE JDBC DRIVER PATH” Name out of the list (second page) and click its link

Set its “Value” to the “directory” (not the actual path + filename) where your ojdbc6.jar resides on your file system

We can set this path externally, either a stand alone ojdbc6.jar or find it with Oracle client packages, i.e. C:\app\\product\11.2.0\client_1

Click “Apply”, then “Save” (on top)

Back to WAS Admin Console, go to Security -> Global security

On “Authentication” panel, expand “Java Authentication and Authorization Service” -> J2C authentication data

Click “New”

Give it an Alias name, i.e. Alias_Oracle and input our current databases’ credential: User ID = your_db_username, Password = your_db_password

Click “Apply”, then “Save”

Go to Resources -> JDBC -> JDBC providers

Make sure that the right Scope has been selected, i.e. Node=DOMAINHOSTNAMENode01 or something

Click “New” to create a new JDBC provider

Step 1: Select “Oracle” from “Database type” menu | Provider type = Oracle JDBC Driver | Implementation type = Connection pool data source

Leave the “Name” as default, i.e. “Oracle JDBC Driver”

Step 2: if you have setup the ORACLE JDBC DRIVER PATH correctly, it should have the appropriate “Class path” to “ojdbc6.jar” already selected for you Step 3: Summary, click “Finish”

Go to Resources -> JDBC -> Data sources

Make sure the right Scope is selected , i.e. Node=DOMAINHOSTNAMENode01 or something

Click “New”

Step 1: Data source name = “Oracle JDBC Driver” | JNDI name = “jdbc/OracleDS”

Step 2: Select “Select an existing JDBC provider” = “Oracle JDBC Driver”

Step 3: URL = “jdbc:oracle:thin:@hostname:port:db_alias” | Data store helper class name = “Oracle11g data store helper”

Step 4: Component-managed authentication alias = DOMAINHOSTNAMENode01/Alias_Oracle

select “DefaultPrincipalMapping”

Step 5: Summary, click “Finish”

Back on “Data sources” screen, select the newly created data source and “Test connection”. If it succeeds, you are done

You can retrieve the data source programmatically:

Context initContext = new InitialContext(); dataSource = (DataSource)initContext.lookup(“jdbc/OracleDS”);

Leave a Reply

You can use these HTML tags

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>