Salve a tutti.
Sto provando a collegare la mia app ad un database presente in un pc nella stessa rete.
La mia configurazione è questa nello starter:
-----------------------------------
Sub Process_Globals
Public mysql As JdbcSQL
Private driver As String = "org.firebirdsql.jdbc.FBDriver"
Private jdbcUrl As String = "jdbc:firebirdsql://192.168.1.226:3050/C:\DRSOFTFB\NISI\DBS\ARC\NISI.FDB"
Private Username As String = "SYSDBA"
Private Password As String = "masterkey"
End Sub
Sub Service_Create
'need to disable it as reading from large JdbcResultSet will cause network requests to be sent on the main thread.
DisableStrictMode
End Sub
Sub Service_Start (StartingIntent As Intent)
End Sub
Sub DisableStrictMode
Dim jo As JavaObject
jo.InitializeStatic("android.os.Build.VERSION")
If jo.GetField("SDK_INT") > 9 Then
Dim policy As JavaObject
policy = policy.InitializeNewInstance("android.os.StrictMode.ThreadPolicy.Builder", Null)
policy = policy.RunMethodJO("permitAll", Null).RunMethodJO("build", Null)
Dim sm As JavaObject
sm.InitializeStatic("android.os.StrictMode").RunMethod("setThreadPolicy", Array(policy))
End If
End Sub
Sub Connect As ResumableSub
mysql.Initialize2(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
Sub CloseConnection
mysql.Close
End Sub
Sub ListAnimals As ResumableSub
Wait For (Connect) Complete (Success As Boolean)
If Success Then
Try
Dim sf As Object = mysql.ExecQuery("SELECT CODICE, DESCRIZIONE FROM ART ")
Wait For (sf) mysql_QueryComplete (Success As Boolean, Crsr As JdbcResultSet)
If Success Then
Do While Crsr.NextRow
Log($"codice: ${Crsr.GetInt("codice")}, Name: ${Crsr.GetString("DESCRIZIONE")}"$)
Loop
Crsr.Close
End If
Catch
Success = False
Log(LastException)
End Try
CloseConnection
End If
Return Success
End Sub
Sub Service_TaskRemoved
'This event will be raised when the user removes the app from the recent apps list.
End Sub
------------
quando provo a collegarmi nel db ho questo errore :
Logger connesso a: samsung GT-I9295
--------- beginning of main
*** Service (starter) Create ***
** Service (starter) Start **
** Activity (main) Create, isFirst = true **
** Activity (main) Resume **
Error occurred on line: 36 (Starter)
java.lang.reflect.InvocationTargetException
at java.lang.reflect.Method.invoke(Native Method)
at java.lang.reflect.Method.invoke(Method.java:372)
at anywheresoftware.b4a.keywords.Common.CallSubDebug(Common.java:1050)
at b4a.example3.main$ResumableSub_Activity_Click.resume(main.java:413)
at b4a.example3.main._activity_click(main.java:387)
at java.lang.reflect.Method.invoke(Native Method)
at java.lang.reflect.Method.invoke(Method.java:372)
at anywheresoftware.b4a.shell.Shell.runMethod(Shell.java:732)
at anywheresoftware.b4a.shell.Shell.raiseEventImpl(Shell.java:348)
at anywheresoftware.b4a.shell.Shell.raiseEvent(Shell.java:255)
at java.lang.reflect.Method.invoke(Native Method)
at java.lang.reflect.Method.invoke(Method.java:372)
at anywheresoftware.b4a.ShellBA.raiseEvent2(ShellBA.java:144)
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:197)
at anywheresoftware.b4a.BA.raiseEvent(BA.java:193)
at anywheresoftware.b4a.objects.ViewWrapper$1.onClick(ViewWrapper.java:80)
at android.view.View.performClick(View.java:5197)
at android.view.View$PerformClick.run(View.java:20926)
at android.os.Handler.handleCallback(Handler.java:739)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:145)
at android.app.ActivityThread.main(ActivityThread.java:5942)
at java.lang.reflect.Method.invoke(Native Method)
at java.lang.reflect.Method.invoke(Method.java:372)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1388)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1183)
Caused by: java.lang.RuntimeException: java.lang.reflect.InvocationTargetException
at anywheresoftware.b4a.debug.Debug.CallSub4(Debug.java:336)
at anywheresoftware.b4a.debug.Debug.CallSubNew(Debug.java:282)
... 26 more
Caused by: java.lang.reflect.InvocationTargetException
at java.lang.reflect.Method.invoke(Native Method)
at java.lang.reflect.Method.invoke(Method.java:372)
at anywheresoftware.b4a.debug.Debug.CallSub4(Debug.java:318)
... 27 more
Caused by: java.lang.RuntimeException: Class not found: org.firebirdsql.jdbc.FBDriver
Are you missing an #AdditionalJar attribute setting?
at anywheresoftware.b4j.objects.SQL.Initialize2(SQL.java:54)
at b4a.example3.starter$ResumableSub_Connect.resume(starter.java:370)
at b4a.example3.starter._connect(starter.java:346)
at b4a.example3.starter$ResumableSub_ListAnimals.resume(starter.java:168)
at b4a.example3.starter._listanimals(starter.java:140)
... 30 more
--------- beginning of system
*** Service (starter) Create ***
** Service (starter) Start **
** Activity (main) Create, isFirst = true **
** Activity (main) Resume **
** Activity (main) Resume **
** Activity (main) Pause, UserClosed = true **
** Service (starter) Destroy (ignored)**
*** Service (starter) Create ***
** Service (starter) Start **
** Activity (main) Create, isFirst = true **
** Activity (main) Resume **
Error occurred on line: 36 (Starter)
java.lang.reflect.InvocationTargetException
at java.lang.reflect.Method.invoke(Native Method)
at java.lang.reflect.Method.invoke(Method.java:372)
at anywheresoftware.b4a.keywords.Common.CallSubDebug(Common.java:1050)
at b4a.example3.main$ResumableSub_Activity_Click.resume(main.java:413)
at b4a.example3.main._activity_click(main.java:387)
at java.lang.reflect.Method.invoke(Native Method)
at java.lang.reflect.Method.invoke(Method.java:372)
at anywheresoftware.b4a.shell.Shell.runMethod(Shell.java:732)
at anywheresoftware.b4a.shell.Shell.raiseEventImpl(Shell.java:348)
at anywheresoftware.b4a.shell.Shell.raiseEvent(Shell.java:255)
at java.lang.reflect.Method.invoke(Native Method)
at java.lang.reflect.Method.invoke(Method.java:372)
at anywheresoftware.b4a.ShellBA.raiseEvent2(ShellBA.java:144)
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:197)
at anywheresoftware.b4a.BA.raiseEvent(BA.java:193)
at anywheresoftware.b4a.objects.ViewWrapper$1.onClick(ViewWrapper.java:80)
at android.view.View.performClick(View.java:5197)
at android.view.View$PerformClick.run(View.java:20926)
at android.os.Handler.handleCallback(Handler.java:739)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:145)
at android.app.ActivityThread.main(ActivityThread.java:5942)
at java.lang.reflect.Method.invoke(Native Method)
at java.lang.reflect.Method.invoke(Method.java:372)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1388)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1183)
Caused by: java.lang.RuntimeException: java.lang.reflect.InvocationTargetException
at anywheresoftware.b4a.debug.Debug.CallSub4(Debug.java:336)
at anywheresoftware.b4a.debug.Debug.CallSubNew(Debug.java:282)
... 26 more
Caused by: java.lang.reflect.InvocationTargetException
at java.lang.reflect.Method.invoke(Native Method)
at java.lang.reflect.Method.invoke(Method.java:372)
at anywheresoftware.b4a.debug.Debug.CallSub4(Debug.java:318)
... 27 more
Caused by: java.lang.RuntimeException: Class not found: org.firebirdsql.jdbc.FBDriver
Are you missing an #AdditionalJar attribute setting?
at anywheresoftware.b4j.objects.SQL.Initialize2(SQL.java:54)
at b4a.example3.starter$ResumableSub_Connect.resume(starter.java:370)
at b4a.example3.starter._connect(starter.java:346)
at b4a.example3.starter$ResumableSub_ListAnimals.resume(starter.java:168)
at b4a.example3.starter._listanimals(starter.java:140)
... 30 more
----------------
qualcuno mi puo aiutare.... ??
Sto provando a collegare la mia app ad un database presente in un pc nella stessa rete.
La mia configurazione è questa nello starter:
-----------------------------------
Sub Process_Globals
Public mysql As JdbcSQL
Private driver As String = "org.firebirdsql.jdbc.FBDriver"
Private jdbcUrl As String = "jdbc:firebirdsql://192.168.1.226:3050/C:\DRSOFTFB\NISI\DBS\ARC\NISI.FDB"
Private Username As String = "SYSDBA"
Private Password As String = "masterkey"
End Sub
Sub Service_Create
'need to disable it as reading from large JdbcResultSet will cause network requests to be sent on the main thread.
DisableStrictMode
End Sub
Sub Service_Start (StartingIntent As Intent)
End Sub
Sub DisableStrictMode
Dim jo As JavaObject
jo.InitializeStatic("android.os.Build.VERSION")
If jo.GetField("SDK_INT") > 9 Then
Dim policy As JavaObject
policy = policy.InitializeNewInstance("android.os.StrictMode.ThreadPolicy.Builder", Null)
policy = policy.RunMethodJO("permitAll", Null).RunMethodJO("build", Null)
Dim sm As JavaObject
sm.InitializeStatic("android.os.StrictMode").RunMethod("setThreadPolicy", Array(policy))
End If
End Sub
Sub Connect As ResumableSub
mysql.Initialize2(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
Sub CloseConnection
mysql.Close
End Sub
Sub ListAnimals As ResumableSub
Wait For (Connect) Complete (Success As Boolean)
If Success Then
Try
Dim sf As Object = mysql.ExecQuery("SELECT CODICE, DESCRIZIONE FROM ART ")
Wait For (sf) mysql_QueryComplete (Success As Boolean, Crsr As JdbcResultSet)
If Success Then
Do While Crsr.NextRow
Log($"codice: ${Crsr.GetInt("codice")}, Name: ${Crsr.GetString("DESCRIZIONE")}"$)
Loop
Crsr.Close
End If
Catch
Success = False
Log(LastException)
End Try
CloseConnection
End If
Return Success
End Sub
Sub Service_TaskRemoved
'This event will be raised when the user removes the app from the recent apps list.
End Sub
------------
quando provo a collegarmi nel db ho questo errore :
Logger connesso a: samsung GT-I9295
--------- beginning of main
*** Service (starter) Create ***
** Service (starter) Start **
** Activity (main) Create, isFirst = true **
** Activity (main) Resume **
Error occurred on line: 36 (Starter)
java.lang.reflect.InvocationTargetException
at java.lang.reflect.Method.invoke(Native Method)
at java.lang.reflect.Method.invoke(Method.java:372)
at anywheresoftware.b4a.keywords.Common.CallSubDebug(Common.java:1050)
at b4a.example3.main$ResumableSub_Activity_Click.resume(main.java:413)
at b4a.example3.main._activity_click(main.java:387)
at java.lang.reflect.Method.invoke(Native Method)
at java.lang.reflect.Method.invoke(Method.java:372)
at anywheresoftware.b4a.shell.Shell.runMethod(Shell.java:732)
at anywheresoftware.b4a.shell.Shell.raiseEventImpl(Shell.java:348)
at anywheresoftware.b4a.shell.Shell.raiseEvent(Shell.java:255)
at java.lang.reflect.Method.invoke(Native Method)
at java.lang.reflect.Method.invoke(Method.java:372)
at anywheresoftware.b4a.ShellBA.raiseEvent2(ShellBA.java:144)
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:197)
at anywheresoftware.b4a.BA.raiseEvent(BA.java:193)
at anywheresoftware.b4a.objects.ViewWrapper$1.onClick(ViewWrapper.java:80)
at android.view.View.performClick(View.java:5197)
at android.view.View$PerformClick.run(View.java:20926)
at android.os.Handler.handleCallback(Handler.java:739)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:145)
at android.app.ActivityThread.main(ActivityThread.java:5942)
at java.lang.reflect.Method.invoke(Native Method)
at java.lang.reflect.Method.invoke(Method.java:372)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1388)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1183)
Caused by: java.lang.RuntimeException: java.lang.reflect.InvocationTargetException
at anywheresoftware.b4a.debug.Debug.CallSub4(Debug.java:336)
at anywheresoftware.b4a.debug.Debug.CallSubNew(Debug.java:282)
... 26 more
Caused by: java.lang.reflect.InvocationTargetException
at java.lang.reflect.Method.invoke(Native Method)
at java.lang.reflect.Method.invoke(Method.java:372)
at anywheresoftware.b4a.debug.Debug.CallSub4(Debug.java:318)
... 27 more
Caused by: java.lang.RuntimeException: Class not found: org.firebirdsql.jdbc.FBDriver
Are you missing an #AdditionalJar attribute setting?
at anywheresoftware.b4j.objects.SQL.Initialize2(SQL.java:54)
at b4a.example3.starter$ResumableSub_Connect.resume(starter.java:370)
at b4a.example3.starter._connect(starter.java:346)
at b4a.example3.starter$ResumableSub_ListAnimals.resume(starter.java:168)
at b4a.example3.starter._listanimals(starter.java:140)
... 30 more
--------- beginning of system
*** Service (starter) Create ***
** Service (starter) Start **
** Activity (main) Create, isFirst = true **
** Activity (main) Resume **
** Activity (main) Resume **
** Activity (main) Pause, UserClosed = true **
** Service (starter) Destroy (ignored)**
*** Service (starter) Create ***
** Service (starter) Start **
** Activity (main) Create, isFirst = true **
** Activity (main) Resume **
Error occurred on line: 36 (Starter)
java.lang.reflect.InvocationTargetException
at java.lang.reflect.Method.invoke(Native Method)
at java.lang.reflect.Method.invoke(Method.java:372)
at anywheresoftware.b4a.keywords.Common.CallSubDebug(Common.java:1050)
at b4a.example3.main$ResumableSub_Activity_Click.resume(main.java:413)
at b4a.example3.main._activity_click(main.java:387)
at java.lang.reflect.Method.invoke(Native Method)
at java.lang.reflect.Method.invoke(Method.java:372)
at anywheresoftware.b4a.shell.Shell.runMethod(Shell.java:732)
at anywheresoftware.b4a.shell.Shell.raiseEventImpl(Shell.java:348)
at anywheresoftware.b4a.shell.Shell.raiseEvent(Shell.java:255)
at java.lang.reflect.Method.invoke(Native Method)
at java.lang.reflect.Method.invoke(Method.java:372)
at anywheresoftware.b4a.ShellBA.raiseEvent2(ShellBA.java:144)
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:197)
at anywheresoftware.b4a.BA.raiseEvent(BA.java:193)
at anywheresoftware.b4a.objects.ViewWrapper$1.onClick(ViewWrapper.java:80)
at android.view.View.performClick(View.java:5197)
at android.view.View$PerformClick.run(View.java:20926)
at android.os.Handler.handleCallback(Handler.java:739)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:145)
at android.app.ActivityThread.main(ActivityThread.java:5942)
at java.lang.reflect.Method.invoke(Native Method)
at java.lang.reflect.Method.invoke(Method.java:372)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1388)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1183)
Caused by: java.lang.RuntimeException: java.lang.reflect.InvocationTargetException
at anywheresoftware.b4a.debug.Debug.CallSub4(Debug.java:336)
at anywheresoftware.b4a.debug.Debug.CallSubNew(Debug.java:282)
... 26 more
Caused by: java.lang.reflect.InvocationTargetException
at java.lang.reflect.Method.invoke(Native Method)
at java.lang.reflect.Method.invoke(Method.java:372)
at anywheresoftware.b4a.debug.Debug.CallSub4(Debug.java:318)
... 27 more
Caused by: java.lang.RuntimeException: Class not found: org.firebirdsql.jdbc.FBDriver
Are you missing an #AdditionalJar attribute setting?
at anywheresoftware.b4j.objects.SQL.Initialize2(SQL.java:54)
at b4a.example3.starter$ResumableSub_Connect.resume(starter.java:370)
at b4a.example3.starter._connect(starter.java:346)
at b4a.example3.starter$ResumableSub_ListAnimals.resume(starter.java:168)
at b4a.example3.starter._listanimals(starter.java:140)
... 30 more
----------------
qualcuno mi puo aiutare.... ??