In this blog post, we are going to develop the SOA composite application which is going to use the Database adapter to check if the customer account number is current or expired.
We will be using the Oracle Database to store the customer account information.
Let`s start the SQL Developer:
Add the sysdba connection information to login to the Oracle Database:
3. Once logged in to the DB. Create a user ‘togodemo’ and grant access to the user:
GRANT CONNECT, RESOURCE TO togodemo IDENTIFIED BY togodemo;
Login to the database with the new user and password:
4. Once logged in, run the following query to create the customeraccountInfo table and populate it.
CREATE TABLE CUSTOMERACCOUNTINFO(FIRST_NAME VARCHAR2(30),LAST_NAME VARCHAR2(30),ACCOUNTNUMBER VARCHAR2(20) NOT NULL,CUSTOMERACCOUNT NUMBER,STATUS VARCHAR2(20) NOT NULL); INSERT INTO CUSTOMERACCOUNTINFO VALUES (‘John’,'Morrison’,’512300001000′,’1′, ‘CURRENT’); insert into CUSTOMERACCOUNTINFO VALUES ( ’Mark’,'Simpsons’, ’612600001000′,’2′, ‘EXPIRED’); Exit; |
Now, we are using Weblogic Server to deploy our code. Let`s create a data source and configure it with the DB Adapter.
1. Login to the Weblogic Console using Administrator username and password.
2. Go To Environment –> Services –> DataSources.
3. New –> Generic Data Source.
Name: — togodemods
JNDI NAME: — jdbc/togodemods
DB Type: — Oracle
DB Driver: — Oracle (Thin XA)
DB Url: — jdbc:oracle:thin:@192.168.1.5:1522:ORCL
DB user: — togodemo
DB password: — togodemo
4. Test the connection.
5. Select Target & Finish.
Now let`s configure the connection pool information with DB Adapter:
1.Login to the Weblogic Console using Administrator username and password.
2. Click on Deployments –> DB Adapter –> Configuration –> Outbound Connection Pools.
3. New –> Select the Outbound Connection Group –> NEXT
4. Add JNDI Name as: eis/DB/togodemods
5. Click Finish.
6. Click on Deployments –> DB Adapter –> Configuration –> Outbound Connection Pools –> Expand javax.resource.cci.connectionFactory.
7. Click on eis/DB/togodemods
8. Add the property value for the datasource:
Now, it`s time to develop the application. We will use the Jdeveloper IDE to develop the application.
1. Start the Jdeveloper –> New.
2. Add the project name and select the technology.
3. Select the Composite Template as an Empty Template:
4. Once created; the composite is going to look like this in the editor.
In the next blog post; we are going to add the Db Adapter, Mediator and Webservice. Please subscribe to this blog and get the update on upcoming blog posts.