connect to the Oracle database using Business Connectivity Services (BCS) in SharePoint 2010

Ratings:
(4)
Views:0
Banner-Img
  • Share this blog:

 

Connect to the Oracle Database 

With SharePoint 2010, BCS ships with out-of-box features such as solutions, services, and tools that may connect to external data an easy task. Whether you want to retrieve Outlook contacts in a list offline or edit the contents of your document file or share your excel sheet online or reuse data from dynamic InfoPath forms or just update your business presentation, BCS enables deep content sharing, editing, and integration in SharePoint 2010 with SharePoint Designer and Visual Studio tools. To connect to the SQL database we can use either SharePoint designer (where we can connect directly to the SQL or using WCF or through .Net Assembly) or using Visual Studio (BDC Model). In case of connecting to the Oracle database, we don't have a direct option in the SharePoint designer, so we can use BCS Meta Man to create an external content type. Prerequisites: I. A local installation of either SharePoint Foundation 2010 or SharePoint Server 2010, ii. Oracle Client (Version: 10g), iii. Visual Studio 2010 and iv. BCS Meta Man. Oracle

Aspired to become a SharePoint? Explore the post to discover the know-how on the " SharePoint Training" course

Database: Table Name: HR.CUSTOMERS 16   Note: In the above table CUSTOMER_ID is the Primary Key. Creating a BCS External Content Type: Steps Involved: The following steps should be followed to create a BCS External Content Type using Visual Studio 2010. v. Open Visual Studio 2010. vi. Go to File => New => Project. vii. Select the Empty SharePoint Project under the installed template category SharePoint 2010 and name it as BCSUsingOracleDatabase. viii. Click OK. ix. Check "Deploy as a farm solution". x. Click Finish. xi. Right-click the Solution Explorer and add a New Item. xii. Select BCSMetaMan under the installed template category Lightning Tools and name it as BCSMetaManForOracle. xiii. Click ADD. xiv. Add System.Data.OracleClient reference to your project. xv. Connect to the Oracle Database. Go to Tools => Connect to Database. 17

  • Add Connection wizard will pop up.
  • Choose the Data Source as Oracle Database (Oracle Client).
  • Enter the Server Name, User Name, and Password and Click on Test Connection and then click OK.

In the Server Explorer, you can view the Oracle Database as shown below. 18 xvi. Create an External Content Type Using BCS Meta Man. You will find the BCS Meta Man menu item in the menu bar. 19

  • Click on BCS Meta Man - > BCS Meta Man Data Source Explorer.
  • Click on the "Add Connection" button of the data source explorer.
  • In the Connection Dialog choose the Data Source as Oracle.
  • Enter the Database Name, User Name, and Password.
  • Click Connect.

Oracle Database will be displayed with all tables. 20

  • Drag and drop the HR.CUSTOMERS table in the BCS Meta Man design surface.

In the Model, Type wizard select .Net assembly and click OK. 21

  • Entity Creation wizard will pop up, click next.
  • By default, CUSTOMER_ID will be selected as an identifier. Click Next.
  • Select all the methods that are available and click Generate.

22 BCS Meta Man will add new files to the project which contain generated C# code. 23 You'll also see the External Content Type on the design surface as shown below. 24   xvii. Build the Project. xviii. Once it is built successfully, Deploy the project and follow the same steps to create External List and configure the security settings as explained in the earlier

About Author
Authorlogo
Name
TekSlate
Author Bio

TekSlate is the best online training provider in delivering world-class IT skills to individuals and corporates from all parts of the globe. We are proven experts in accumulating every need of an IT skills upgrade aspirant and have delivered excellent services. We aim to bring you all the essentials to learn and master new technologies in the market with our articles, blogs, and videos. Build your career success with us, enhancing most in-demand skills in the market.


Stay Updated


Get stories of change makers and innovators from the startup ecosystem in your inbox