B4J Question ODBC Sybase

soyVB6

Active Member
Licensed User
Hi guys, I'm migrating an old system that I did some years in power builder.
I could not achieve a connection to the database, this is what I have:

In my user DSN (odbc) I have my database connected and it works like this for my old system.

I managed to find a jconn2.jar library in the sybase installation with which I tried to connect:


B4X:
#AdditionalJar: C:\Program Files\Sybase\Shared\jConnect-5_5\classes\jconn2.jar

dim JDBCurl as string = "jdbc:sybase:Tds" <---- I'm sure something is missing here that I don't know what it is? help!

db.Initialize2("com.sybase.jdbc2.jdbc.SybDriver",JDBCurl,"dba","sql")
 

soyVB6

Active Member
Licensed User
I am happy to solve the correct url was:
B4X:
    Dim myhost As String = "pepe"
    Dim puerto As Int = 2638 'This port is shown by C: \ Program Files \ Sybase \ SQL Anywhere 9 \ x64 \ dbeng9.exe when it is running
    Dim dbName As String = "/COBROS"
Dim JDBCurl As String = "jdbc:sybase:Tds:127.0.0.1:"&puerto&dbName&"?LITERAL_PARAMS=True&PACKETSIZE=512&HOSTNAME="&myhost
db.Initialize2("com.sybase.jdbc2.jdbc.SybDriver",JDBCurl,"user","pass")

Thank you so much !
 
Upvote 0
Top