Buongiorno a tutti, 
Sto sfruttando il seguente esempio per collegarmi ad un database mysql e leggere i record della tabella operatori
quando avvio il debug scrive soltanto Log("---------- Inizio tentativo di connessione a MySQL ----------")
sembra che la app tenti di eseguire le due righe qui sotto ma dopo un po la app termina da sola
la sub MYSQL_Ready non viene mai eseguita
Qualcuno sa quale può essere il problema?
	
	
	
	
	
	
	
		
			
			
			
			
			
		
	
	
	
		
	
	
		
	
questo è il codice completo
	
	
	
	
	
	
	
		
			
			
			
			
			
		
	
	
	
		
	
	
		
	
			
			Sto sfruttando il seguente esempio per collegarmi ad un database mysql e leggere i record della tabella operatori
quando avvio il debug scrive soltanto Log("---------- Inizio tentativo di connessione a MySQL ----------")
sembra che la app tenti di eseguire le due righe qui sotto ma dopo un po la app termina da sola
la sub MYSQL_Ready non viene mai eseguita
Qualcuno sa quale può essere il problema?
			
				B4X:
			
		
		
		MYSQL.Initialize(Me, "MYSQL")
MYSQL.Connect("com.mysql.jdbc.Driver", $"jdbc:mysql://${MyLocation}/${MyDataBaseName}?useSSL=false"$, MyUsername, MyPassword)questo è il codice completo
			
				B4X:
			
		
		
		#Region  Project Attributes
    #ApplicationLabel: SQL
    #VersionCode: 1
    #VersionName:
    'SupportedOrientations possible values: unspecified, landscape or portrait.
    #SupportedOrientations: unspecified
    #CanInstallToExternalStorage: False
#End Region
'MySQL Connector/J Driver
#AdditionalJar: mysql-connector-java-5.1.47-bin.jar
'MSSQL Connector/J Driver
#AdditionalJar: jtds-1.3.1.jar
#Region  Activity Attributes
    #FullScreen: False
    #IncludeTitle: True
#End Region
Sub Process_Globals
    'These global variables will be declared once when the application starts.
    'These variables can be accessed from all modules.
    
    Dim MYSQL As SD_SQL
    Private MyLocation As String = "ftp.miosito.it"
    Private MyUsername As String = "miouser"
    Private MyPassword As String = "1234abcd"
    Private MyDataBaseName As String = "miodb"
    
End Sub
Sub Globals
    'These global variables will be redeclared each time the activity is created.
    Private ListViewMy As ListView
End Sub
Sub Activity_Create(FirstTime As Boolean)
    Activity.LoadLayout("Layout1")
    Sleep(100)
    Log("---------- Inizio tentativo di connessione a MySQL ----------")
    Try
        MYSQL.Initialize(Me, "MYSQL")
        MYSQL.Connect("com.mysql.jdbc.Driver", $"jdbc:mysql://${MyLocation}/${MyDataBaseName}?useSSL=false"$, MyUsername, MyPassword)
        Log("---------- Connessione in corso ----------")
    Catch
        Log("Errore di connessione: " & LastException.Message)
    End Try
    Wait For MYSQL_Ready (Success As Boolean)
    If Success Then
        Log("---------- Connesso correttamente a MySQL ----------")
    Else
        Log("---------- Connessione a MySQL fallita ----------")
    End If
End Sub
Sub Activity_Resume
End Sub
Sub Activity_Pause (UserClosed As Boolean)
End Sub
Sub MYSQL_Ready (Success As Boolean)
    ListViewMy.SingleLineLayout.Label.TextColor = Colors.Black
    ListViewMy.SingleLineLayout.Label.TextSize = 13
    ListViewMy.Clear
    If Success Then
        Try
            Dim RS As SD_ResultSet = MYSQL.ExecQuery("SELECT * FROM operatori")
            If RS.IsInitialized Then
                Do While RS.NextRow
                    ListViewMy.AddSingleLine(RS.GetString2(1)) ' Assicurati che questo indice sia corretto
                    Log("riga!")
                Loop
                RS.Close
            Else
                Log("ResultSet non inizializzato")
            End If
        Catch
            Log(LastException.Message)
        End Try
    Else
        Log("Connessione al database non riuscita")
    End If
End Sub