Operating System - HP-UX
1752815 Members
6064 Online
108789 Solutions
New Discussion юеВ

Re: Testing ODBC connections

 
Sean OB_1
Honored Contributor

Testing ODBC connections

Hello!

I have a coldfusion server that uses ODBC to connect to a sybase server on the same physical machine.

However I cannot get coldfusion to connect to the database, even though I can connect using the isql program and the same user/pass that I'm using in odbc.

Does anyone have any ideas on how I can trouble shoot the odbc connection? Is there a tester I can use to make sure the odbc.ini is setup correctly?
6 REPLIES 6
Tom Jackson
Valued Contributor

Re: Testing ODBC connections

Hi Sean:

I would try to use a connection method supported by Sybase and ODBC.
I found this searching google.com ->
http://www.sybase.com/detail/1,6904,1019717,00.html.

Tom
Sean OB_1
Honored Contributor

Re: Testing ODBC connections

Tom,

I'm not sure what your point is here.

The setup I have is exactly as shown in that document, with the exception of that it's on Unix and not on NT, and we are using Netscape Enterprise Server instead of IIS.

What is it that I'm supposed to get out of this document?
Tom Jackson
Valued Contributor

Re: Testing ODBC connections

Hi Sean:

I have connected to Oracle DBs from java servlets running on Tomcat and WebSphere web servers. What I had to do is find a supported connection method that works.

I'm not familiar with sybase, coldfusion or the server you are running, however, I've had the same problem.

I started with the database and identified connection methods. I gathered the required class files, put them in my build path, then started to code the connection.

Do you know how far you are getting? Can you instanciate the databse driver that connect to the DB? You can put in some code that will display where you are in the connection process (write to System.out.println or write to the response PrintWriter). A better way to do it would be inside a debugger.

You may also want to search google using keywords that describe how you are trying to connect.

hth,

Tom
Sean OB_1
Honored Contributor

Re: Testing ODBC connections

Ok, thanks for the reply. The method I am trying to use is the documented method by both Coldfusion and Sybase.

Both say this is the correct way to connect to the server.

And in fact it works fine when connecting from a different server to the sybase server using the same ColdFusion code.

We are moving the coldserver instance onto the same server as sybase. But on that server coldfusion cannot connect to the sybase instance.
Sean OB_1
Honored Contributor

Re: Testing ODBC connections

Oh yeah I forgot to add that I've been searching on this since yesterday morning and trying the various things that I've found.

This is kind of a last ditch attempt to find help, but I figured someone here has probably done this already or has some knowledge about it.
Tom Jackson
Valued Contributor

Re: Testing ODBC connections

Hi Sean:

The first thing I do to connect to a DB is create an instance of the DB driver. Then I use the connect method of the driver to connect to the DB. In the connect method I specify an URL path to the DB and a user/password.

It sounds like you are able to get to the driver since you are not getting a class not found error at run time.

Since you can't seem to connect, try changing the URL field in your call. Try specifying localhost or your IP address for the hostname field. Or you may also be able to leave it blank. The call may require a space holder such as a comma, null, or "" in the hostname field.

Tom