{"id":3696,"date":"2014-11-06T07:55:50","date_gmt":"2014-11-05T23:55:50","guid":{"rendered":"http:\/\/rmohan.com\/?p=3696"},"modified":"2014-11-06T07:55:50","modified_gmt":"2014-11-05T23:55:50","slug":"setup-an-oracle-jdbc-data-source-on-websphere-application-server-7-step-by-step","status":"publish","type":"post","link":"https:\/\/mohan.sg\/?p=3696","title":{"rendered":"Setup an Oracle JDBC Data Source on WebSphere Application Server 7 Step-by-Step"},"content":{"rendered":"<p>Login to the Admin Console of the running server, i.e. Window -> Show Views -> Servers | right click the server -> Run Administration -> Run Administrative Console<\/p>\n<p>Environment -> WebSphere variables<\/p>\n<p>Find \u201cORACLE JDBC DRIVER PATH\u201d Name out of the list (second page) and click its link<\/p>\n<p>Set its \u201cValue\u201d to the \u201cdirectory\u201d (not the actual path + filename) where your ojdbc6.jar resides on your file system<\/p>\n<p>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<\/p>\n<p>Click \u201cApply\u201d, then \u201cSave\u201d (on top)<\/p>\n<p>Back to WAS Admin Console, go to Security -> Global security<\/p>\n<p>On \u201cAuthentication\u201d panel, expand \u201cJava Authentication and Authorization Service\u201d -> J2C authentication data<\/p>\n<p>Click \u201cNew\u201d<\/p>\n<p>Give it an Alias name, i.e. Alias_Oracle and input our current databases\u2019 credential: User ID = your_db_username, Password = your_db_password<\/p>\n<p>Click \u201cApply\u201d, then \u201cSave\u201d<\/p>\n<p>Go to Resources -> JDBC -> JDBC providers<\/p>\n<p>Make sure that the right Scope has been selected, i.e. Node=DOMAINHOSTNAMENode01 or something<\/p>\n<p>Click \u201cNew\u201d to create a new JDBC provider<\/p>\n<p>Step 1: Select \u201cOracle\u201d from \u201cDatabase type\u201d menu | Provider type = Oracle JDBC Driver | Implementation type = Connection pool data source<\/p>\n<p>Leave the \u201cName\u201d as default, i.e. \u201cOracle JDBC Driver\u201d<\/p>\n<p>Step 2: if you have setup the ORACLE JDBC DRIVER PATH correctly, it should have the appropriate \u201cClass path\u201d to \u201cojdbc6.jar\u201d already selected for you Step 3: Summary, click \u201cFinish\u201d<\/p>\n<p>Go to Resources -> JDBC -> Data sources<\/p>\n<p>Make sure the right Scope is selected , i.e. Node=DOMAINHOSTNAMENode01 or something<\/p>\n<p>Click \u201cNew\u201d<\/p>\n<p>Step 1: Data source name = \u201cOracle JDBC Driver\u201d | JNDI name = \u201cjdbc\/OracleDS\u201d<\/p>\n<p>Step 2: Select \u201cSelect an existing JDBC provider\u201d = \u201cOracle JDBC Driver\u201d<\/p>\n<p>Step 3: URL = \u201cjdbc:oracle:thin:@hostname:port:db_alias\u201d | Data store helper class name = \u201cOracle11g data store helper\u201d<\/p>\n<p>Step 4: Component-managed authentication alias = DOMAINHOSTNAMENode01\/Alias_Oracle<\/p>\n<p>select \u201cDefaultPrincipalMapping\u201d<\/p>\n<p>Step 5: Summary, click \u201cFinish\u201d<\/p>\n<p>Back on \u201cData sources\u201d screen, select the newly created data source and \u201cTest connection\u201d. If it succeeds, you are done<\/p>\n<p>You can retrieve the data source programmatically:<\/p>\n<p>Context initContext = new InitialContext(); dataSource = (DataSource)initContext.lookup(&#8220;jdbc\/OracleDS&#8221;);<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Login to the Admin Console of the running server, i.e. Window -> Show Views -> Servers | right click the server -> Run Administration -> Run Administrative Console<\/p>\n<p>Environment -> WebSphere variables<\/p>\n<p>Find \u201cORACLE JDBC DRIVER PATH\u201d Name out of the list (second page) and click its link<\/p>\n<p>Set its \u201cValue\u201d to the \u201cdirectory\u201d (not [&#8230;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[25],"tags":[],"_links":{"self":[{"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/posts\/3696"}],"collection":[{"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/mohan.sg\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=3696"}],"version-history":[{"count":1,"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/posts\/3696\/revisions"}],"predecessor-version":[{"id":3697,"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/posts\/3696\/revisions\/3697"}],"wp:attachment":[{"href":"https:\/\/mohan.sg\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=3696"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mohan.sg\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=3696"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mohan.sg\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=3696"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}