Android Question JDBC allows remote connections to the database?

Could someone guide me to know if jdbc technology allows remote connections to the database?

B4X:
Sub Process_Globals
    'These global variables will be declared once when the application starts.
    'These variables can be accessed from all modules.
    '====variables de conexion
    
   
    Public vSERVER As String ="fdb1028.awardspace.net"
    Public mysql As JdbcSQL
    Private driver As String = "com.mysql.jdbc.Driver"
    
    Private jdbcUrl As String = "jdbc:mysql://"&vSERVER &"/4306936_aulanet" 
    Private Username As String = "4306936_aulanet"
    Private Password As String = "passworddb"
    '====fin

End Sub

When variables are configured locally it works great, but when configured for remote access from a host it returns false

B4X:
Sub Connect As ResumableSub
    'mysql.IsInitialized=true
    mysql.InitializeAsync("mysql", driver, jdbcUrl, Username, Password)
    Wait For MySQL_Ready (Success As Boolean)
    If Success = False Then
        Log("Check unfiltered logs for JDBC errors.")
        
        
    End If
    Return Success
End Sub



Any suggestions?
 

Erel

B4X founder
Staff member
Licensed User
Longtime User
Yes JdbcSQL supports remote connections. It actually transparent from the client perspective.

1. Check Log(LastException).
2. Generally speaking it is not recommended to directly connect mobile apps to the db. A solution such as jRDC2 will work better.
3. Check the server firewall and make sure that it allows incoming connections on the relevant port.
4. If you can run apps directly on the server then start with B4J. If it works then it is likely a firewall / network issue.
 
Upvote 0

udg

Expert
Licensed User
Longtime User
Another check: is your MySql installation configured to accept remote connections?
 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…