Community forum

Welcome Guest! To enable all features please Login or Register.

Notification

Icon
Error

Options
View
Go to last post Go to first unread
Offline FabienV  
#1 Posted : Tuesday, December 3, 2013 4:41:05 PM(UTC)
FabienV

Rank: Paid support

Joined: 9/9/2010(UTC)
Posts: 6
Location: Geneva

Was thanked: 1 time(s) in 1 post(s)
Hi,

we have multiple servers in our organisation I'm trying to automate some tasks (like changing and managing connection parameters).
But I can't seem to find the right way to create an oracle connection, my parameters do not look anything like what I see when I retrieve an existing connection.

What is the encoding/method used to set the SQLConnection.ParameterValue from string to byte[]? Do you have some code snippets to provide?

thanks,
Fabien

Edited by moderator Friday, February 21, 2014 9:48:55 AM(UTC)  | Reason: Not specified

Offline Support  
#2 Posted : Tuesday, December 3, 2013 4:47:17 PM(UTC)
Support

Rank: Official support

Medals:
Joined: 2/23/2008(UTC)
Posts: 9,291

Thanks: 565 times
Was thanked: 320 time(s) in 308 post(s)
These parameters are encrypted. You can encrypt using ServerObject.Encrypt() method but you cannot decrypt it.
Henrik
Support
http://www.visualcron.com

Please like VisualCron on facebook!
Offline FabienV  
#3 Posted : Tuesday, December 3, 2013 5:00:45 PM(UTC)
FabienV

Rank: Paid support

Joined: 9/9/2010(UTC)
Posts: 6
Location: Geneva

Was thanked: 1 time(s) in 1 post(s)
thanks, I'm fine with just encrypting but cannot find this method on the server class which class does it belong to?
I'm using version 6.0.9
Offline Support  
#4 Posted : Tuesday, December 3, 2013 5:07:17 PM(UTC)
Support

Rank: Official support

Medals:
Joined: 2/23/2008(UTC)
Posts: 9,291

Thanks: 565 times
Was thanked: 320 time(s) in 308 post(s)
Sorry, could be ClientObj.Encrypt()
Henrik
Support
http://www.visualcron.com

Please like VisualCron on facebook!
Offline FabienV  
#5 Posted : Tuesday, December 3, 2013 5:43:18 PM(UTC)
FabienV

Rank: Paid support

Joined: 9/9/2010(UTC)
Posts: 6
Location: Geneva

Was thanked: 1 time(s) in 1 post(s)
thanks that's it

here is the code snippet for those interested (oracle connection)

connection = new ConnectionClass();
connection.Name = "dbname@serverid";
connection.ProtocolType = ConnectionClass.ProtocolT.SQL;
connection.SecurityMode = ConnectionClass.SecurityModeT.Explicit;
connection.SQLConnection.DataBaseType = SQLConnectionClass.DatabaseT.Oracle;
connection.SQLConnection.DataProvider = SQLConnectionClass.DataProviderT.DirectOracle;

connection.SQLConnection.ConnectionTypeId = 224;
connection.SQLConnection.StorageType = SQLConnectionClass.StorageT.Database;
connection.SQLConnection.WizardId = 1;
string connection_string = "Data Source=serverid;User Id=dbname;Password=dbpassword;";
connection.SQLConnection.ConnectionString = ClientObject.Encrypt(connection_string);
SQLConnectionParameterClass p_server = new SQLConnectionParameterClass();
p_server.ParameterName = "Data Source";
p_server.ParameterValue = ClientObject.Encrypt("serverid");

connection.SQLConnection.ConnectionParameters.Add(p_server);

SQLConnectionParameterClass p_user_id = new SQLConnectionParameterClass();
p_user_id.ParameterName = "User Id";
p_user_id.ParameterValue = ClientObject.Encrypt("dbname");

connection.SQLConnection.ConnectionParameters.Add(p_user_id);

SQLConnectionParameterClass p_password = new SQLConnectionParameterClass();
p_password.ParameterName = "Password";
p_password.ParameterValue = ClientObject.Encrypt("dbname");

connection.SQLConnection.ConnectionParameters.Add(p_password);

ServerObject.Connections.Add(connection);

thanks 1 user thanked FabienV for this useful post.
Support on 12/5/2013(UTC)
Offline Support  
#6 Posted : Thursday, December 5, 2013 9:07:21 AM(UTC)
Support

Rank: Official support

Medals:
Joined: 2/23/2008(UTC)
Posts: 9,291

Thanks: 565 times
Was thanked: 320 time(s) in 308 post(s)
Thanks for the feedback!
Henrik
Support
http://www.visualcron.com

Please like VisualCron on facebook!
Users browsing this topic
Guest
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

Powered by YAF.NET | YAF.NET © 2003-2016, Yet Another Forum.NET
This page was generated in 0.249 seconds.
Scroll to Top