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:
#AdditionalJar: ojdbc8.jar

B4X:
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:
Sub Oracle_Ready (Success As Boolean)
    If Success Then
        Log("Ok")
    End If
End Sub


any idea of the problem?
Thanks in advance
 

JohnJ

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:
#AdditionalJar: ojdbc8.jar

B4X:
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:
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:
#AdditionalJar: ojdbc8.jar

B4X:
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:
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

jose luis gudino

Active Member
Licensed User
Longtime User
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

OliverA

Expert
Licensed User
Longtime User
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

OliverA

Expert
Licensed User
Longtime User
Upvote 0

OliverA

Expert
Licensed User
Longtime User
Did you turn off the log filtering?
 
Upvote 0

jose luis gudino

Active Member
Licensed User
Longtime User

Attachments

  • imagen_2024-03-04_113924794.png
    imagen_2024-03-04_113924794.png
    18.2 KB · Views: 29
Upvote 0

OliverA

Expert
Licensed User
Longtime User
If you change Oracle_Ready to
B4X:
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
Top