Legacy Support > ThingWorx XMPP Edge MicroServer (EMS) Software > .NET Reference Information > Edge Configuration Examples
  
Edge Configuration Examples
Using OLE-DB through the .NET Edge Thing
You can also use the OSISoft OLE-DB provider interface using the ThingWorx .NET Edge Thing connectivity software. This allows you to connect securely to a PI Server through a firewall, and provides a much better performing interface on a WAN (JDBC can be sluggish over an Internet or WAN connection, depending on the level of service).
You need to install the ThingWorx EMS and the .NET Edge Thing software on a server with the appropriate OLE-DB drivers to make this connection work. Then connect the Edge Thing to ThingWorx platform as you would with any other connector interface for OLE-DB. Then you can define queries on ThingWorx platform for namespace and data retrieval.
You must create an ADO.NET Edge Thing using the ThingWorx Edge Configuration Manager software. To configure an ADO.NET Edge Thing to communicate with a PI Server via OLEDB, you need to set the following:
Connection String: Provider=PIOLEDB;Initial Catalog=<target PI catalog>;Data Source=<PI Server Machine>
User ID: valid PI user name
Password: valid PI password
<target PI catalog> may be one of the catalogs available via OLEDB. See the OSISoft OLEDB manual for details.
Using JDBC directly to the ThingWorx Web Application
OSIsoft provides a JDBC level I driver for communicating between Java applications and OSIsoft's PI and AF Server products. This is only recommended when the THingWorx server and the OSISoft server are on the same LAN, and not separated by a firewall.
Pre-Requisites
Before you can connect to PI using JDBC, you must install OSISoft JDBC driver software on the respective client machine, in this case the ThingWorx server. You can package the driver in an extension package and install it to the ThingWorx application without a need to restart the server or to re-install the driver after an upgrade. You can access the proper JDBC driver from the \\bss-intranet\downloads\vCampus share location.
If you are running on Windows, install pijdbc_2010R2_.exe
If you are running on Linux, install pijdbc_2010R2-x86-x64_.tar.gz
To install the software, refer to the companion PDF document: PI JDBC Basics Learn How to Query PI. This document also provides a quick and easy way to verify the installation was successful and that you can connect to your PI Server.
Using OSIsoft's JDBC Driver
The trick to using the JDBC driver is getting the URL correct. The PDF describes this, but in summary, you will need a URL similar to the following:
jdbc:pisql://<PI DAS Server>:<port>/<PI JDBC Connection String>
where PI DAS Server is the name/ip of the machine where the PI DAS (Data Access Server) is installed and running.
* 
By default, the PI DAS Server listens on port http:5460 and https:5461. You must specify the machine name/ip + the port. In addition, the PI DAS application uses Windows Integrated Security by default, so the user name and password provided are the Windows credentials to connect to the PI DAS application.