diff options
Diffstat (limited to '')
5 files changed, 24 insertions, 4 deletions
diff --git a/OpenGridServices/OpenGrid.Framework.Data.MySQL/MySQLGridData.cs b/OpenGridServices/OpenGrid.Framework.Data.MySQL/MySQLGridData.cs index 46183b4..6ac8cc3 100644 --- a/OpenGridServices/OpenGrid.Framework.Data.MySQL/MySQLGridData.cs +++ b/OpenGridServices/OpenGrid.Framework.Data.MySQL/MySQLGridData.cs | |||
@@ -14,7 +14,15 @@ namespace OpenGrid.Framework.Data.MySQL | |||
14 | /// </summary> | 14 | /// </summary> |
15 | public void Initialise() | 15 | public void Initialise() |
16 | { | 16 | { |
17 | database = new MySQLManager("localhost", "database", "username", "password", "false"); | 17 | IniFile GridDataMySqlFile = new IniFile("mysql_connection.ini"); |
18 | string settingHostname = GridDataMySqlFile.ParseFileReadValue("hostname"); | ||
19 | string settingDatabase = GridDataMySqlFile.ParseFileReadValue("database"); | ||
20 | string settingUsername = GridDataMySqlFile.ParseFileReadValue("username"); | ||
21 | string settingPassword = GridDataMySqlFile.ParseFileReadValue("password"); | ||
22 | string settingPooling = GridDataMySqlFile.ParseFileReadValue("pooling"); | ||
23 | string settingPort = GridDataMySqlFile.ParseFileReadValue("port"); | ||
24 | |||
25 | database = new MySQLManager(settingHostname, settingDatabase, settingUsername, settingPassword, settingPooling, settingPort); | ||
18 | } | 26 | } |
19 | 27 | ||
20 | /// <summary> | 28 | /// <summary> |
diff --git a/OpenGridServices/OpenGrid.Framework.Data.MySQL/MySQLManager.cs b/OpenGridServices/OpenGrid.Framework.Data.MySQL/MySQLManager.cs index 670d3c9..ea7e2ac 100644 --- a/OpenGridServices/OpenGrid.Framework.Data.MySQL/MySQLManager.cs +++ b/OpenGridServices/OpenGrid.Framework.Data.MySQL/MySQLManager.cs | |||
@@ -25,11 +25,11 @@ namespace OpenGrid.Framework.Data.MySQL | |||
25 | /// <param name="username">The username logging into the database</param> | 25 | /// <param name="username">The username logging into the database</param> |
26 | /// <param name="password">The password for the user logging in</param> | 26 | /// <param name="password">The password for the user logging in</param> |
27 | /// <param name="cpooling">Whether to use connection pooling or not, can be one of the following: 'yes', 'true', 'no' or 'false', if unsure use 'false'.</param> | 27 | /// <param name="cpooling">Whether to use connection pooling or not, can be one of the following: 'yes', 'true', 'no' or 'false', if unsure use 'false'.</param> |
28 | public MySQLManager(string hostname, string database, string username, string password, string cpooling) | 28 | public MySQLManager(string hostname, string database, string username, string password, string cpooling, string port) |
29 | { | 29 | { |
30 | try | 30 | try |
31 | { | 31 | { |
32 | string connectionString = "Server=" + hostname + ";Port=3306;Database=" + database + ";User ID=" + username + ";Password=" + password + ";Pooling=" + cpooling + ";"; | 32 | string connectionString = "Server=" + hostname + ";Port=" + port + ";Database=" + database + ";User ID=" + username + ";Password=" + password + ";Pooling=" + cpooling + ";"; |
33 | dbcon = new MySqlConnection(connectionString); | 33 | dbcon = new MySqlConnection(connectionString); |
34 | 34 | ||
35 | dbcon.Open(); | 35 | dbcon.Open(); |
diff --git a/OpenGridServices/OpenGrid.Framework.Data.MySQL/MySQLUserData.cs b/OpenGridServices/OpenGrid.Framework.Data.MySQL/MySQLUserData.cs index 0741272..df681eb 100644 --- a/OpenGridServices/OpenGrid.Framework.Data.MySQL/MySQLUserData.cs +++ b/OpenGridServices/OpenGrid.Framework.Data.MySQL/MySQLUserData.cs | |||
@@ -12,7 +12,15 @@ namespace OpenGrid.Framework.Data.MySQL | |||
12 | 12 | ||
13 | public void Initialise() | 13 | public void Initialise() |
14 | { | 14 | { |
15 | database = new MySQLManager("host", "database", "user", "password", "false"); | 15 | IniFile GridDataMySqlFile = new IniFile("mysql_connection.ini"); |
16 | string settingHostname = GridDataMySqlFile.ParseFileReadValue("hostname"); | ||
17 | string settingDatabase = GridDataMySqlFile.ParseFileReadValue("database"); | ||
18 | string settingUsername = GridDataMySqlFile.ParseFileReadValue("username"); | ||
19 | string settingPassword = GridDataMySqlFile.ParseFileReadValue("password"); | ||
20 | string settingPooling = GridDataMySqlFile.ParseFileReadValue("pooling"); | ||
21 | string settingPort = GridDataMySqlFile.ParseFileReadValue("port"); | ||
22 | |||
23 | database = new MySQLManager(settingHostname, settingDatabase, settingUsername, settingPassword, settingPooling, settingPort); | ||
16 | } | 24 | } |
17 | 25 | ||
18 | public UserProfileData getUserByName(string name) | 26 | public UserProfileData getUserByName(string name) |
diff --git a/OpenGridServices/OpenGrid.Framework.Data/OpenGrid.Framework.Data.csproj b/OpenGridServices/OpenGrid.Framework.Data/OpenGrid.Framework.Data.csproj index 2f47478..b033c6c 100644 --- a/OpenGridServices/OpenGrid.Framework.Data/OpenGrid.Framework.Data.csproj +++ b/OpenGridServices/OpenGrid.Framework.Data/OpenGrid.Framework.Data.csproj | |||
@@ -81,6 +81,9 @@ | |||
81 | <Compile Include="GridData.cs"> | 81 | <Compile Include="GridData.cs"> |
82 | <SubType>Code</SubType> | 82 | <SubType>Code</SubType> |
83 | </Compile> | 83 | </Compile> |
84 | <Compile Include="IniConfig.cs"> | ||
85 | <SubType>Code</SubType> | ||
86 | </Compile> | ||
84 | <Compile Include="SimProfileData.cs"> | 87 | <Compile Include="SimProfileData.cs"> |
85 | <SubType>Code</SubType> | 88 | <SubType>Code</SubType> |
86 | </Compile> | 89 | </Compile> |
diff --git a/OpenGridServices/OpenGrid.Framework.Data/OpenGrid.Framework.Data.dll.build b/OpenGridServices/OpenGrid.Framework.Data/OpenGrid.Framework.Data.dll.build index c054f8a..281295f 100644 --- a/OpenGridServices/OpenGrid.Framework.Data/OpenGrid.Framework.Data.dll.build +++ b/OpenGridServices/OpenGrid.Framework.Data/OpenGrid.Framework.Data.dll.build | |||
@@ -12,6 +12,7 @@ | |||
12 | </resources> | 12 | </resources> |
13 | <sources failonempty="true"> | 13 | <sources failonempty="true"> |
14 | <include name="GridData.cs" /> | 14 | <include name="GridData.cs" /> |
15 | <include name="IniConfig.cs" /> | ||
15 | <include name="SimProfileData.cs" /> | 16 | <include name="SimProfileData.cs" /> |
16 | <include name="UserData.cs" /> | 17 | <include name="UserData.cs" /> |
17 | <include name="UserProfileData.cs" /> | 18 | <include name="UserProfileData.cs" /> |