How to connect to Oracle using Service Name instead of SID

I have a Java application that uses JDBC (via JPA) that was connecting to a development database using hostname, port and Oracle SID, like this: jdbc:oracle:thin:@oracle.hostserver1.mydomain.ca:1521:XYZ XYZ was the Oracle SID. Now I need to connect to a different Oracle database that does not use a SID, but uses an Oracle “Service Name” instead. I … Read more

Get connection string from App.config

var connection = ConnectionFactory.GetConnection( ConfigurationManager.ConnectionStrings[“Test”] .ConnectionString, DataBaseProvider); And this is my App.config: <?xml version=”1.0″ encoding=”utf-8″ ?> <configuration> <connectionStrings> <add name=”Test” connectionString=”Data Source=.;Initial Catalog=OmidPayamak;Integrated Security=True” providerName=”System.Data.SqlClient” /> </connectionStrings> </configuration> But when my project runs this is my error: Object reference not set to an instance of an object. 22 Answers 22

What is the difference between Integrated Security = True and Integrated Security = SSPI?

I have two apps that use Integrated Security. One assigns Integrated Security = true in the connection string, and the other sets Integrated Security = SSPI. What is the difference between SSPI and true in the context of Integrated Security? 9 s 9 Integrated Security=true; doesn’t work in all SQL providers, it throws an exception … Read more