Sample Connection String for oraSession

Discussion of open issues, suggestions and bugs regarding ODAC (Oracle Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
syscwl
Posts: 13
Joined: Mon 03 Oct 2011 17:44

Sample Connection String for oraSession

Post by syscwl » Mon 06 May 2013 21:54

I'm running Embarc CBuilder 2010...dropped an oracle seesion on form and need a connectioin string -- can some one provide me with a sample of what it should look like...or point me to a sample??Thanks.

WZehntner
Posts: 13
Joined: Tue 23 Apr 2013 11:58

Re: Sample Connection String for oraSession

Post by WZehntner » Tue 07 May 2013 09:32

May be this helps you (code snippet from Delphi):

OraSession1.Options.Direct := true; // true=direkt Mode;
OraSession1.Options.ConnectionTimeout := 60000; // 60 seconds
OraSession1.LoginPrompt := false;
OraSession1.Username := 'TEST';
OraSession1.Password := 'test';
OraSession1.Server := '194.76.125.47:1521:NEW'; // adjust your IP
try // e2
OraSession1.Ping; // in case of failure raises an exception
// or immediately do the connect:
// OraSession1.Connect;
except // e2
on E: exception do
begin
memo1.lines.add (' Ping-OraSession Exception '+E.Message );
exit;
end;
end; //e2
end;

syscwl
Posts: 13
Joined: Mon 03 Oct 2011 17:44

Re: Sample Connection String for oraSession

Post by syscwl » Tue 07 May 2013 10:26

So, there is no connection string when one chooses directconnect????

WZehntner
Posts: 13
Joined: Tue 23 Apr 2013 11:58

Re: Sample Connection String for oraSession

Post by WZehntner » Tue 07 May 2013 12:17

In my example the connectstring is something like:

Login Prompt=False;Data Source=194.76.125.47:1521:NEW;User ID=TEST; Password=test;Schema=NEW;Connection Timeout=60000;Direct=True

AlexP
Devart Team
Posts: 5530
Joined: Tue 10 Aug 2010 11:35

Re: Sample Connection String for oraSession

Post by AlexP » Tue 07 May 2013 14:51

Hello,

The ConnectionString property can be set in several ways:
1) SQLPlus analogue

Code: Select all

 OraSession.ConnectString := 'username/password@server'; OCI mode
 OraSession.ConnectString := 'username/password@host:port:sid'; Direct mode
2) ADO analogue

Code: Select all

 OraSession.ConnectString := 'Data Source=server;User ID='username;Password=password'; OCI mode
OraSession.ConnectString := 'Data Source=host:port:sid;User ID='username;Password=password;Direct=true'; Direct mode

Post Reply