Registriert seit: 30. Nov 2005
Ort: München
5.767 Beiträge
Delphi 10.4 Sydney
|
Zeos 6.6.6 -> Oracle 10g Verbindungsversuch schlägt fehl
27. Okt 2010, 15:58
Datenbank: Oracle • Version: 10g • Zugriff über: Zeos 6.6.6-stable
Hallo,
stehe vor einem Problem und weiß nicht so recht weiter.
Ich versuche mich auf den Port 1521 (dort läuft der Listener) zu verbinden.
Delphi-Quellcode:
var
ZConnection : TZConnection;
SQLQuery : TZReadOnlyQuery;
dataSet : TClientDataSet;
SQLStatement : TStringList;
dbResult : TStringList;
begin
ZConnection := TZConnection.Create( nil);
try
ZConnection.Protocol := ' oracle-9i';
ZConnection.HostName := configData.getDatabaseSettings.dbServerAddress;
ZConnection.Port := configData.getDatabaseSettings.dbListenerPort;
ZConnection.User := configData.getDatabaseSettings.dbUserName;
ZConnection.Password := configData.getDatabaseSettings.dbPassword;
ZConnection.database := ' oss';
try
ZConnection.Connect;
logData.addItem(' Connection to db established');
except
on E: Exception do
logData.addItem(' Error connecting to the database: '+e. Message);
end;
Hier haut es mich immer raus:
Delphi-Quellcode:
procedure TZOracleConnection.Open;
var
Status: Integer;
LogMessage: string;
// ConnectTimeout: Integer;
// SQL: PChar;
procedure CleanupOnFail;
begin
FPlainDriver.HandleFree(FContextHandle, OCI_HTYPE_SVCCTX);
FContextHandle := nil;
FPlainDriver.HandleFree(FErrorHandle, OCI_HTYPE_ERROR);
FErrorHandle := nil;
FPlainDriver.HandleFree(FServerHandle, OCI_HTYPE_SERVER);
FServerHandle := nil;
end;
begin
if not Closed then Exit;
LogMessage := Format(' CONNECT TO "%s" AS USER "%s"', [Database, User]);
{ Sets a default port number. }
if Port = 0 then Port := 1521;
{ Sets connection timeout. }
// ConnectTimeout := StrToIntDef(Info.Values['timeout'], 0);
{ Connect to Oracle database. }
if FHandle = nil then
FPlainDriver.EnvInit(FHandle, OCI_DEFAULT, 0, nil);
FErrorHandle := nil;
FPlainDriver.HandleAlloc(FHandle, FErrorHandle, OCI_HTYPE_ERROR, 0, nil);
FServerHandle := nil;
FPlainDriver.HandleAlloc(FHandle, FServerHandle, OCI_HTYPE_SERVER, 0, nil);
FContextHandle := nil;
FPlainDriver.HandleAlloc(FHandle, FContextHandle, OCI_HTYPE_SVCCTX, 0, nil);
Status := FPlainDriver.ServerAttach(FServerHandle, FErrorHandle,
PChar( string(Database)), Length(Database), 0);
try
CheckOracleError(FPlainDriver, FErrorHandle, Status, lcConnect, LogMessage);
//Hier springt die Routine immer in die Exception
// FPlainDriver : TZOracle9iPlainDriver($C6DB38) as IZOraclePlainDriver
// FErrorHandle: nil
// Status : -1
// lcConnect : lcConnect
// LogMessage: CONNECT TO ... as USER ..
except
CleanupOnFail;
raise;
end;
// stuff deleted
Die Exception ist auch nicht sehr aussagekräftig:
Zitat:
---------------------------
Debugger Exception Notification
---------------------------
Project .... raised exception class EZSQLException with message ' SQL Error: ë#B'.
---------------------------
Break Continue Help
---------------------------
Mache ich hier etwas grundsätzlich falsch?
Kennt jemand das Problem und deren Lösung?
Nachtrag: die oci.dll ist Version 11.2.0.1
Nachtrag2: Der Port ist erreichbar: mit telnet IP-Adresse 1521 kommt eine Verbindung zustande.
Nachtrag3: Der Inhalt der ErrorMessage:
Zitat:
('ë', '#', 'B', #0, #0, #4, #0, #0, #1, #0, #0, #0, 'X', 'R', 'Æ', #0, #3, #0, #0, #0, #16, #157, 'P', #0, #3, #0, #0, #0, '(', 'ù', #18, #0, #20, 'ù', #18, #0, '"', '/', '@', #0, 'J', 'N', '@', #0, 'L', 'Ò', 'A', #0, 'x', 'ù', #18, #0, #6, '/', '@', #0, 'Õ', 'N', '@', #0, #12, #0, #0, #0, #3, #0, #0, #0, #24, 'O', '@', #0, #16, #157, 'P', #0, #0, #16, 'Ä', #0, #3, #0, #0, #0, 'L', 'S', '@', #0, 'L', 'Ò', 'A', #0, '™', #16, 'B', #0, 'x', 'ù', #18, #0, '\', 'ù', #18, #0, '¸', #16, 'B', #0, 'À', #16, 'B', #0, 'ü', 'ù', #18, #0, #0, #16, 'Ä', #0, #4, #0, #0, #0, #0, #0, #0, #0, '„', 'ù', #18, #0, #4, #0, #0, #0, #0, #16, 'Ä', #0, 'u', '/', '@', #0, #24, #16, 'Ä', #0, 'Ê', '"', 'B', #0, #4, #0, #0, #0, #0, #16, 'Ä', #0, 'e', ' ', 'B', #0, #0, #16, 'Ä', #0, '|', '!', 'B', #0, #0, #0, #0, #0, ',', #13, #0, #0, 'X', 'R', 'Æ', #0, ':', #3, 'A', #0, #0, #4, #0, #0, #0, #0, #0, #0, 'k', 'õ', 'Æ', #0, #1, #0, #0, #0, ',', #13, #0, #0, #8, 'á', 'S', #0, 'ë', '#', 'B', #0, #0, #4, #0, #0, #1, #0, #0, #0, '¸', 'R', 'Æ', #0, #3, #0, #0, #0, #8, 'á', 'S', #0, #8, #0, #0, #0, 'W', 'I', 'S', #0, '(', 'Ý', 'Å', #0, 'à', 'ù', #18, #0, 'f', 'R', 'S', #0)
kann da leider nicht erkennen.
Grüße
Klaus
Klaus
Geändert von Klaus01 (27. Okt 2010 um 18:18 Uhr)
|