Android Question MySQL-Library to connect

samperizal

Active Member
Licensed User
Longtime User
Hello

I'm using MySQL-Library to connect to mysql and I can not connect. How can I know the error it gives?

this is the code used

Label_Status.Text ="Conenectando a la base de datos"
db.Initialize("MySQLC",Main.cDbIP,Main.cDbUserName,Main.cDbPassword,Main.cDataBase,True,False)
db.EnableReconnect
db.check_connection
db.ReconnectTime = 1
str_sqlc = "select Telefono_Destino,Mensaje from sms_out"
db.QueryASync(str_sqlc,"")
db.CloseDatabase


Sub MySQLC_QueryResult(data As List, meta As Map)
' Msgbox(meta,"")
If meta = Null Then
Msgbox("rrrrr","")
' sweet.Initialize("OErrorImportar")
' sweet.AlertType = sweet.TypeError
' sweet.showCancelButton(False).showContentText(True).withConfirmText("Ok").withContentText("Error al importar Mensajes").withTitleText("A T E N C I O N").show
Else
datossql = data
For i=0 To datossql.Size-1
Dim dataset As Map = datossql.Get(i)
For o = 0 To dataset.Size -1
'dataset.GetValueAt(o) & "','"
Msgbox(dataset.GetValueAt(o),"")

Next
Next
End If
End Sub

Thanks in advance
 

DonManfred

Expert
Licensed User
Longtime User
Please use [CODE]code here...[/CODE] tags when posting code.
 
Upvote 0

samperizal

Active Member
Licensed User
Longtime User
hello the log is the following


*** Service (starter) Create ***
** Service (starter) Start **
** Activity (main) Create, isFirst = true **
** Activity (main) Resume **
** Activity (main) Pause, UserClosed = false **
** Activity (configuracion_sim_card) Create, isFirst = true **
** Activity (configuracion_sim_card) Resume **
** Activity (configuracion_sim_card) Pause, UserClosed = true **
** Activity (main) Resume **
** Activity (main) Pause, UserClosed = false **
** Activity (configurar) Create, isFirst = true **
** Activity (configurar) Resume **
** Activity (configurar) Pause, UserClosed = true **
** Activity (main) Resume **
** Activity (main) Pause, UserClosed = false **
** Activity (enviar_sms) Create, isFirst = true **
Can not connect to the MySQL Database Server. Please check your configuration.
Hostname: 173.212.250.34
Username: Usr_SMS
Error: Communications link failure
The last packet sent successfully to the server was 0 milliseconds ago. The driver has not received any packets from the server.
Raising.. mysqlc_status
MySQL Database not connected!
MySQL Database not connected!
lib:Exception:java.lang.NullPointerException: Attempt to invoke interface method 'java.sql.Statement java.sql.Connection.createStatement()' on a null object reference
** Activity (enviar_sms) Resume **
** Activity (enviar_sms) Pause, UserClosed = true **
** Activity (main) Resume **
lib:Raising.. alert_onconfirm()


And with the same credentials I connect with heidisql.
 
Upvote 0
Top