Android Question Connect database in oracle from B4A

jose luis gudino

Active Member
Licensed User
Longtime User
Hello, I am using the following code to connect to an Oracle database from B4A but I have not been able to do so.

B4X: Copy
#AdditionalJar: ojdbc8.jar

B4X: Copy
Dim DBLocation ="xxx.xxx.xx.xxx" As String
    Dim DBUsername ="vamos" As String
    Dim DBPassword ="Jlg10644263" As String
    sql.InitializeAsync("Oracle", "oracle.jdbc.driver.OracleDriver", $"jdbc:oracle:thin:@${DBLocation}:1521:xe"$, DBUsername, DBPassword)

B4X: Copy
Sub Oracle_Ready (Success As Boolean)
    If Success Then
        Log("Ok")
    End If
End Sub


any idea of the problem?
Thanks in advance
 
Hello, I am using the following code to connect to an Oracle database from B4A but I have not been able to do so.

B4X: Copy
#AdditionalJar: ojdbc8.jar

B4X: Copy
Dim DBLocation ="xxx.xxx.xx.xxx" As String
    Dim DBUsername ="vamos" As String
    Dim DBPassword ="Jlg10644263" As String
    sql.InitializeAsync("Oracle", "oracle.jdbc.driver.OracleDriver", $"jdbc:oracle:thin:@${DBLocation}:1521:xe"$, DBUsername, DBPassword)

B4X: Copy
Sub Oracle_Ready (Success As Boolean)
    If Success Then
        Log("Ok")
    End If
End Sub


any idea of the problem?
Thanks in advance
There are lots
Hello, I am using the following code to connect to an Oracle database from B4A but I have not been able to do so.

B4X: Copy
#AdditionalJar: ojdbc8.jar

B4X: Copy
Dim DBLocation ="xxx.xxx.xx.xxx" As String
    Dim DBUsername ="vamos" As String
    Dim DBPassword ="Jlg10644263" As String
    sql.InitializeAsync("Oracle", "oracle.jdbc.driver.OracleDriver", $"jdbc:oracle:thin:@${DBLocation}:1521:xe"$, DBUsername, DBPassword)

B4X: Copy
Sub Oracle_Ready (Success As Boolean)
    If Success Then
        Log("Ok")
    End If
End Sub


any idea of the problem?
Thanks in advance
There are lots of posts in the forum on connecting to an oracle database. The driver name in your post looks a bit strange
 
Upvote 0
Thanks for the information. I did connect to the database via jRDC and it works perfectly. The idea is to make the connection in the same way as it was done with B4J
 
Upvote 0
Try using ojdbc7.jar w/Android. Android's Java-cloned sub-system may not be able to handle all of the Java 8 code used in ojdbc8.jar
 
Upvote 0
Upvote 0
Did you turn off the log filtering?
 
Upvote 0

Attachments

  • imagen_2024-03-04_113924794.png
    imagen_2024-03-04_113924794.png
    18.2 KB · Views: 452
Upvote 0
If you change Oracle_Ready to
Code: Copy
Sub Oracle_Ready (Success As Boolean)
    If Success Then
        Log("Ok")
    Else
        Log("Not ok")
    End If
End Sub
Will you get (eventually) a "Not ok" ?
 
Upvote 0
Back
Top