Hola, gracias por el aporte, estoy tratando de hacerla conexion Mysql, a un servidor de pago, pero cuando me dice que debo poner la ruta del java, no se como averiguarla, a alguien le ha pasado? gracias...
Sub Globals
Dim mh1 As MysqlHandler
Dim rs1 As ResultSet
Dim sv1 As ScrollView
Dim lv1 As ListView
Dim hsv1 As HorizontalScrollView
End Sub
Sub Activity_Create(FirstTime As Boolean)
'Do not forget to load the layout file created with the visual designer. For example:
'Activity.LoadLayout("Layout1")
mh1.Initialize("host","dbname","user","pass")
If mh1.isConnected = False Then
Msgbox(mh1.SQLError, "Connection Error:")
Return
End If
' rs1 = mh1.Query("INSERT INTO `dbname`.`dbtable` (`C1`, `C2`, `C3`, `C4`) VALUES ('4', '4', '4', '4')")
rs1 = mh1.Query("select * from dbtable")
If rs1.IsInitialized = False Then
Msgbox("ResultSet is empty" & CRLF & mh1.SQLError, "Warning")
Return
End If
hsv1.Initialize(rs1.ColumnCount * 150dip,0)
Activity.AddView(hsv1,0,0,100%x,100%y)
sv1.Initialize(rs1.RowCount * 30dip)
hsv1.Panel.AddView(sv1,0,0,rs1.ColumnCount*150dip,100%y)
Dim l As Label
For i=0 To rs1.RowCount - 1
rs1.Position = i
For j=0 To rs1.ColumnCount - 1
l.Initialize("label" & j)
l.Text = rs1.GetString(j)
l.TextColor = Colors.Black
l.Color = Colors.White
sv1.Panel.AddView(l,j*150dip,i*30dip,149dip,29dip)
Next
Next
mh1.Close
End Sub
Sub Button1_click
Dim AdoConn As AdoConnection
Dim AdoRec As AdoRecordset
Dim Result As Int
Dim ResultS As String
'Replace the values, with your Mysql Server properties
AdoConn.ConnectionString("host","puerto","UTF-8","dbname","dbuser","pass")
AdoConn.ConnectionTimeout=1
AdoConn.LoginTimeout=1
AdoConn.SocketTimeout=1
'if the mysql driver return error, the subs AdoConnectionError will activate
AdoConn.InitializeEvent
AdoConn.Open
AdoRec.InitializeEvent
AdoRec.Connection=AdoConn
'AdoRec.SqlStatement="Select * from Terneros"
AdoRec.AddNew
AdoRec.Field("C1")
AdoRec.Update
'AdoRec.SqlStatement="INSERT INTO Terneros ('C1','C2','C3','C4') VALUES (5,5,5,5)"
'AdoConn.Execute
If AdoRec.isClosed Then
' Do something
Else
' Do something
End If
Log(AdoRec.RecordCount)
If AdoRec.RecordCount>0 Then
Do While Not(AdoRec.EOF)
Log(AdoRec.Field("fieldname"))
AdoRec.MoveNext
Loop
End If
AdoRec.Close
End Sub
Si, probado en 1&1 my web y Mysql
El problema es que no se han adptado las librerias, porque con Rad Studio XE6 conecto directamente con Interbase y Firebird y con Netbeans también.
La pena es que no soy bastante ducho en realizar librerias o acondicionar las existentes.
Un saludo y probad y postear si habeis podido