procedure TTestCase_UIB.Connect;
var
JvUIBDataBase : TJvUIBDataBase;
JvUIBTransaction : TJvUIBTransaction;
JvUIBQuery : TJvUIBQuery;
iId : Integer;
begin
JvUIBDataBase := TJvUIBDataBase.Create(
NIL);
JvUIBTransaction := TJvUIBTransaction.Create(
NIL);
JvUIBQuery := TJvUIBQuery.Create(
NIL);
try
JvUIBTransaction.DataBase:= JvUIBDataBase;
JvUIBQuery.Transaction:= JvUIBTransaction;
JvUIBDataBase.SQLDialect:= 1;
JvUIBDataBase.DatabaseName := '
localhost:testdb';
// db alias fro alias.conf
JvUIBDataBase.UserName := '
sysdba';
JvUIBDataBase.PassWord := '
masterkey';
JvUIBDataBase.Connected:= True;
try
Check(JvUIBDataBase.Connected);
JvUIBQuery.SQL.Add('
Select * From Log');
JvUIBTransaction.StartTransaction;
try
JvUIBQuery.Open;
Check(JvUIBTransaction.InTransaction);
try
while not JvUIBQuery.EOF
do
begin
iId:= JvUIBQuery.Fields['
Id'].AsInteger;
if iId=0
then
begin
end;
JvUIBQuery.Next;
end;
finally
JvUIBQuery.Close;
end;
finally
JvUIBTransaction.Commit;
end;
finally
JvUIBDataBase.Connected:= False;
end;
finally
JvUIBQuery.Free;
JvUIBTransaction.Free;
JvUIBDataBase.Free;
end;
end;
{ TTestCase_UIB.Connect }