LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   unixODBC and sybase (https://www.linuxquestions.org/questions/programming-9/unixodbc-and-sybase-332281/)

eantoranz 06-10-2005 03:06 PM

unixODBC and sybase
 
I'm trying to connect to a sybase DB, but i've been unable to.

This is my .odbc.ini file:
Code:

[ODBC Data Sources]
Smile=DB de Smile

[Smile]
Driver=/opt/sybase/SYBSsa9/lib/libdbodbc9_r.so
UID=x
PWD=y
CommLinks=tcpip
ServerName=fhep_cluster01

[ODBC]
InstallDir=/opt/sybase/SYBSsa9/drivers

When I try to connect with isql, I get this:
Code:

$ isql Smile -v
[08001][unixODBC][Sybase][ODBC Driver][Adaptive Server Anywhere]Unable to connect to database server: Database server not found
[ISQL]ERROR: Could not SQLConnect

I know I've always had to setup JDBC connections giving the IP address and the port of the service, and that normally doesn't fail. This is the first time I try with ODBC, but haven't been able to.
Is there a way I can tell it to use a ip address and a port?
What are the things that I can setup in the ODBC file? I didn't get much information in the ASA Documentation.

Is there a way to ask isql (or unixODBC) to be more verbose on the things that are happening? I noticed that there is no traffic going to the DB server form my host (with tcpdump).

Maybe I can setup a ODBC DSN that uses a JDBC connection, which I know won't fail. Is this possible?

eantoranz 06-13-2005 10:22 AM

Well... I've been able to make a step forward (finally).

It turns out that the odbc driver is trying to stablish a remote connection through localhost. :scratch: Take a look at the log:


Code:

mon jun 13 2005 11:17:41
11:17:41 Application information:
11:17:41 "IP=127.0.0.1;HOST=galileo;OS=Linux 2.6.3-7mdk #1 Wed Mar 17 15:56:42 CET 2004;PID=0xef3;THREAD=0x402962a0;VERSION=9.0.0.1120;API=ODBC;TIMEZONEADJUSTMENT=-240"
11:17:41 Attempting to connect using:
********PWD=********;ENG=192.168.0.3;CON=SQL_DBC_8084c18;LOG=/home/antoranz/odbc.smile.log;LINKS=tcpip
11:17:41 Attempting to connect to a running server...
11:17:41 Trying to start TCPIP link ...
11:17:41 My IP address is 127.0.0.1
11:17:41 My IP address is 127.0.0.1
11:17:41    TCPIP link started successfully
11:17:41 Attempting TCPIP connection (no .asasrv.ini cached address)
11:17:41 LDAP routines could not be found, LDAP support disabled
11:17:41 Looking for server with name 192.168.0.3
11:17:41 I am in a class A network
11:17:41 Sending broadcast to find server
11:17:41 Using broadcast address of: 127.255.255.255:2638
11:17:41 I am in a class A network
11:17:41 Sending broadcast to find server
11:17:41 Using broadcast address of: 127.255.255.255:2638
11:17:42 Resending
11:17:43 Resending
11:17:44 Resending
11:17:45 Resending
11:17:46    Server not found (no reply received)
11:17:46 Failed to connect over TCPIP
11:17:46 Not attempting to autostart server
11:17:46 Cannot connect to server

What's the missing point here? Why is it broadcasting the 127/24 segment? Shouldn't it realize I'm trying to reach 192.0.0/8? (look at the server address in the log file).

Maybe there's a way to force unixODBC to use my IP adress. Is there any?

eantoranz 06-13-2005 10:43 AM

was afiannly able to connect to the DB server.

I had to set some parameters at the CommLinks parameter:
Code:

CommLinks=tcpip(MyIP=192.168.0.240;IP=192.168.0.3:2638; )

eantoranz 12-20-2005 01:54 PM

It's been quite a while since the last post... but I'm back in trouble. :'(

I have switched my box tu ubuntu (kubuntu, as a matter of fact) beezy. Just installed unixodbc, and have to make a little modification for the config file, but I only get this message when I run isql:

Code:

$ isql Smile -v
[01000]▒
[ISQL]ERROR: Could not SQLConnect

And that's it. And not even the log is written, so I guess it's not a problem of the Driver but odbc itself. Any ideas what I'm doing wrong? :scratch:


All times are GMT -5. The time now is 03:14 AM.