Connecting To Firebird Database
Connecting To Firebird Database
Connection pooling
public static void Main(string[] args)
"User=SYSDBA;" +
"Password=masterkey;" +
"Database=SampleDatabase.fdb;" +
"DataSource=localhost;" +
"Port=3050;" +
"Dialect=3;" +
"Charset=NONE;" +
"Role=;" +
"Connection lifetime=15;" +
"Pooling=true;" +
"MinPoolSize=0;" +
"MaxPoolSize=50;" +
"Packet Size=8192;" +
"ServerType=0";
try
{
// Now there are two connections in the pool that matches the connection
string.
// Return the both connections to the pool.
Console.WriteLine ("Return both of the connections to the pool.");
myConnection1.Close();
myConnection2.Close();
Console.WriteLine(e.Message);
}
}
return to top
"User=SYSDBA;" +
"Password=masterkey;" +
"Database=SampleDatabase.fdb;" +
"DataSource=localhost;" +
"Port=3050;" +
"Dialect=3;" +
"Charset=NONE;" +
"Role=;" +
"Connection lifetime=15;" +
"Pooling=true;" +
"Packet Size=8192;" +
"ServerType=0";
myCommand.CommandText =
myCommand.Parameters[0].Value = 1;
myCommand.Parameters[1].Value = GetFileContents(@"GDS.CS");
// Execute Update
myCommand.ExecuteNonQuery();
// Commit changes
myTransaction.Commit();
// Close connection
myConnection.Close();
}
return to top
System.Threading.Thread.Sleep(2000);
connection.Close();
}
return to top
cs.UserID = "SYSDBA";
cs.Password = "masterkey";
cs.Database = "nunit_testdb";
backupSvc.ConnectionString = cs.ToString();
backupSvc.BackupFiles.Add(new FbBackupFile(@"c:\testdb.gbk", 2048));
backupSvc.Verbose = true;
backupSvc.Options = FbBackupFlags.IgnoreLimbo;
backupSvc.Execute();
}
Console.WriteLine(e.Message);
}
return to top
cs.UserID = "SYSDBA";
cs.Password = "masterkey";
cs.Database = "nunit_testdb";
restoreSvc.ConnectionString = cs.ToString();
restoreSvc.BackupFiles.Add(new FbBackupFile(@"c:\testdb.gbk", 2048));
restoreSvc.Verbose = true;
restoreSvc.PageSize = 4096;
restoreSvc.Options = FbRestoreFlags.Create | FbRestoreFlags.Replace;
restoreSvc.Execute();
}
return to top
cs.DataSource = "localhost";
cs.Database = "employee.fdb";
cs.UserID = "SYSDBA";
cs.Password = "masterkey";
cs.Charset = "NONE";
cs.Pooling = false;
connection.Close();
}