in theory, let you pass the mysql connection string into the

mysql manager class.  This could use some testing of inventory
and asset services.  Once this is prooved out, I'll do it for
mssql as well.
0.6.0-stable
Sean Dague 2008-04-24 15:23:49 +00:00
parent 5c660ea0c5
commit c6f6218f60
2 changed files with 21 additions and 3 deletions

View File

@ -174,7 +174,13 @@ namespace OpenSim.Data.MySQL
{ {
// TODO: This will let you pass in the connect string in // TODO: This will let you pass in the connect string in
// the config, though someone will need to write that. // the config, though someone will need to write that.
if (connect == String.Empty) {
// This is old seperate config file
Initialise(); Initialise();
} else {
_dbConnection = new MySQLManager(connect);
TestTables();
}
} }
override public void Initialise() override public void Initialise()

View File

@ -64,11 +64,23 @@ namespace OpenSim.Data.MySQL
/// <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> /// <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>
public MySQLManager(string hostname, string database, string username, string password, string cpooling, public MySQLManager(string hostname, string database, string username, string password, string cpooling,
string port) string port)
{
string s = "Server=" + hostname + ";Port=" + port + ";Database=" + database + ";User ID=" +
username + ";Password=" + password + ";Pooling=" + cpooling + ";";
Initialise(s);
}
public MySQLManager(String connect)
{
Initialise(connect);
}
public void Initialise(String connect)
{ {
try try
{ {
connectionString = "Server=" + hostname + ";Port=" + port + ";Database=" + database + ";User ID=" + connectionString = connect;
username + ";Password=" + password + ";Pooling=" + cpooling + ";";
dbcon = new MySqlConnection(connectionString); dbcon = new MySqlConnection(connectionString);
try try