Oracle 通信: 无法连接到服务器, 或者无法对连接字符串进行语法分析
Oracle.ManagedDataAccess.Client.OracleException (0x80004005): Oracle 通信: 无法连接到服务器, 或者无法对连接字符串进行语法分析 ---> OracleInternal.Network.NetworkException (0x80004005): Oracle 通信: 无法连接到服务器, 或者无法对连接字符串进行语法分析 ---> System.NotImplementedException: The method or operation is not implemented.
at System.Net.Security.NegotiateStream.AuthenticateAsClient (System.Net.NetworkCredential credential, System.String targetName, System.Net.Security.ProtectionLevel requiredProtectionLevel, System.Security.Principal.TokenImpersonationLevel allowedImpersonationLevel) [0x00000] in <ae22a4e8f83c41d69684ae7f557133d9>:0
at OracleInternal.Network.Ano.StartNegotiation () [0x00218] in <6fc3afebc14a48c0abc8cdbcaa680207>:0
at OracleInternal.Network.OracleCommunication.SendConnectPacketAndProcessResponse (OracleInternal.Network.AddressResolution addrRes) [0x000ef] in <6fc3afebc14a48c0abc8cdbcaa680207>:0
at OracleInternal.Network.OracleCommunication.ConnectViaCO (OracleInternal.Network.ConnectionOption connOption, OracleInternal.Network.AddressResolution addrRes) [0x00130] in <6fc3afebc14a48c0abc8cdbcaa680207>:0
at OracleInternal.Network.OracleCommunication.DoConnect (System.String tnsDescriptor) [0x00034] in <6fc3afebc14a48c0abc8cdbcaa680207>:0
at OracleInternal.Network.OracleCommunication.DoConnect (System.String tnsDescriptor) [0x000a1] in <6fc3afebc14a48c0abc8cdbcaa680207>:0
at OracleInternal.Network.OracleCommunication.Connect (System.String tnsDescriptor, System.Boolean doNAHandshake, System.String IName) [0x0000e] in <6fc3afebc14a48c0abc8cdbcaa680207>:0
at OracleInternal.ServiceObjects.OracleConnectionImpl.Connect (Oracle.ManagedDataAccess.Client.ConnectionString cs, System.Boolean bOpenEndUserSession, System.String instanceName) [0x00328] in <6fc3afebc14a48c0abc8cdbcaa680207>:0
at OracleInternal.ConnectionPool.PoolManager`3[PM,CP,PR].Get (Oracle.ManagedDataAccess.Client.ConnectionString csWithDiffOrNewPwd, System.Boolean bGetForApp, System.String affinityInstanceName, System.Boolean bForceMatch) [0x00944] in <6fc3afebc14a48c0abc8cdbcaa680207>:0
at OracleInternal.ConnectionPool.OraclePoolManager.Get (Oracle.ManagedDataAccess.Client.ConnectionString csWithNewPassword, System.Boolean bGetForApp, System.String affinityInstanceName, System.Boolean bForceMatch) [0x0023b] in <6fc3afebc14a48c0abc8cdbcaa680207>:0
at OracleInternal.ConnectionPool.OracleConnectionDispenser`3[PM,CP,PR].Get (Oracle.ManagedDataAccess.Client.ConnectionString cs, PM conPM, Oracle.ManagedDataAccess.Client.ConnectionString pmCS, System.Security.SecureString securedPassword, System.Security.SecureString securedProxyPassword) [0x00314] in <6fc3afebc14a48c0abc8cdbcaa680207>:0
at Oracle.ManagedDataAccess.Client.OracleConnection.Open () [0x0058d] in <6fc3afebc14a48c0abc8cdbcaa680207>:0
at SW.ConnectSQLServerOperate.OpenMySQL () [0x00078] in C:\Users\57891\Desktop\1\华能港务局\华能港务局\Assets\Scripts\ConnectSQLServer\ConnectSQLServerOperate.cs:73
UnityEngine.Debug:Log(Object)
SW.ConnectSQLServerOperate:OpenMySQL() (at Assets/Scripts/ConnectSQLServer/ConnectSQLServerOperate.cs:91)
Test:StartConnectMySQL() (at Assets/Scripts/ConnectSQLServer/Test.cs:91)
UnityEngine.EventSystems.EventSystem:Update() (at D:/Program Files (x86)/2019.3.10f1/Editor/Data/Resources/PackageManager/BuiltInPackages/com.unity.ugui/Runtime/EventSystem/EventSystem.cs:377)
无论什么换什么连接字符都报这个错误
代码
public void OpenMySQL()
{
Test._instance.informationShowText.text = "";
Test._instance.informationShowTextDown.text = "";
try
{
connectStr = "User Id=scott; password=tiger;Data Source=192.168.124.8:1521/orcl; Pooling=false;";
OracleConnection con = new OracleConnection(connectStr);
con.Open();
Test._instance.informationShowText.text = "成功连接服务器!\n";
Test._instance.informationShowTextDown.text = "成功连接服务器!\n";
isConnected = true;
Debug.Log("连接成功!!" );
}
catch (Exception ex)
{
Test._instance.informationShowText.text = "服务器连接已断开...\n";
Test._instance.informationShowTextDown.text = "服务器连接已断开...\n";
Debug.Log("连接失败!!" + ":" + ex.ToString());
isConnected = false;
}
}