• Topic
  • Discussion
  • VOS.VirtOJDBCEntityFrameworkUsage(Last) -- DAVWikiAdmin? , 2017-06-29 07:39:01 Edit WebDAV System Administrator 2017-06-29 03:39:01

    Using Microsoft Entity Frameworks to Access Remote JDBC-accessible Schema Objects with Virtuoso, via an ODBC-to-JDBC Bridge

    This document details the steps required to provide Microsoft Entity Framework access to remote JDBC-accessible Schema Objects using the OpenLink Virtuoso Universal Server. This is achieved by linking the remote Schema Objects into Virtuoso using its built-in Virtual Database engine, through an ODBC-to-JDBC Bridge, and then using the Virtuoso ADO.NET Entity Framework provider to query the remote Schema Objects linked into the Virtuoso Server.

    Prerequisites

    The following must be in place to complete this exercise.

    1. Microsoft Visual Studio 2008 SP1 (or later)
      Microsoft Visual Studio 2008 Service Pack 1 (or later) is required, as previous versions do not include the necessary Entity Framework support.

    2. Virtuoso ADO.NET Entity Framework Provider, v5.10 or later
      The ADO.NET Entity Framework Provider must be installed on the Visual Studio development and deployment host(s). Version 5.10.x or later is required, as previous versions do not include the necessary Entity Frameworks support.

    3. Virtuoso Universal Server, v5.10 or later
      Virtuoso Universal Server Release 5.10 or later is required, as previous versions do not include the necessary Entity Frameworks support. This may be on any host which is TCP/IP accessible from the Visual Studio development and deployment host(s).

    4. ODBC Driver for JDBC Data Sources, also known as an ODBC-to-JDBC Bridge
      The Virtuoso Server uses an ODBC-to-JDBC Bridge to link in the JDBC-accessible Schema Objects. The OpenLink Single-Tier ODBC Driver for JDBC Data Sources will be used in this document, and a functional ODBC Data Source Name (DSN) of "jdbcma" will be assumed to exist on the machine hosting the Virtuoso Server. Any ODBC compliant driver for JDBC data sources should work.

    5. JDBC-accessible DBMS and its associated JDBC Driver
      A JDBC-accessible DBMS hosting the required Schema Objects needs to be available, and a JDBC Driver for same must be available to the ODBC-to-JDBC Bridge. Specific requirements depend on the target DBMS, the JDBC driver, and the ODBC-to-JDBC Bridge. In this document, a remote Virtuoso Northwind Demo database will be used to demonstrate the process, through the Type 4 JDBC Driver for Virtuoso.

    Tasks

    1. Ensure JDBC-accessible DBMS Primary Keys (PKs) are not nullable
      The Visual Studio 2008 Entity Data Model (EDM) requires that all primary keys are NOT Nullable. Visual Studio 2008 will fail to generate an EDM if any are. Therefore, ensure any primary keys to be used are defined as not nullable in the JDBC-accessible database schema before attempting to generate an EDM. In the case of the Virtuoso Northwind Demo database, all primary keys are non nullable. Thus, this should not be an issue.

    2. Install and configure the OpenLink ODBC Driver for JDBC Data Sources

    3. Install and configure OpenLink Virtuoso Universal Server

    4. Link JDBC-accessible tables and other schema objects into OpenLink Virtuoso

    5. Create a Visual Studio-hosted Entity Data Model (EDM)

    6. Use the EDM to create an Entity Frameworks-based ADO.NET Data Service

    7. Use the EDM to create an Entity Frameworks-based Windows DataGrid Form Application

    CategoryDocumentation CategoryVirtuoso CategoryEntityFrameworks CategoryDotNET CategoryJDBC CategoryODBCJDBCBridge