I don't know if this helps, since I use ASE on Linux not ASA on NT but here
goes:

        import com.sybase.jdbcx.*;
       // ....
        public String sServer = "198.151.254.121:1433";
      // ...
        public String url = "jdbc:sybase:Tds:"; // + sServer

The only real difference I can see between my code and your code is you're
using "localhost" whereas I supply a real IP address.  The only other
suggestion is check the port # that ASA is listening on.  I've usually only
seen tcp endpoint errors when a client app is unable to establish a
connection on with a server app because of socket# or ip addr issues.  I've
used this code for ASE & web server running on one machine and ASE & web
server on separate machines.

----- Original Message -----
From: "Wong, Connie" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Friday, March 02, 2001 10:37 AM
Subject: Sybase (ASA7.0.2) connection question


> Hi,
>
> I have trouble using the URL on Sybase. I hope someone can help me.
>
> Configurations:
>
> NT
> Sybase ASA7.0.2
> Tomcat 3.1
> DriverName = "com.sybase.jdbc2.jdbc.SybDriver"
>
> The following files are in my CLASSPATH:
>       c:\Program Files\Sybase\SQL Anywhere 7\jConnect\classes
>       c:\Program Files\Sybase\SQL Anywhere 7\java\jdbcdrv.zip
>       c:\Program Files\Sybase\Shared\jConnect-5_2\classes\jconn2.jar
>
>
> Scenarios:
>
> Case 1. Set URL = "jdbc:sybase:Tds:localhost:2638"
>
>      I got the IOException error:
>
> java.sql.SQLException: JZ006: Caught IOException:
java.net.ConnectException:
> Connection refused: no further information at
> com.sybase.jdbc2.jdbc.ErrorMessage.raiseError(ErrorMessage.java:423) at
> com.sybase.jdbc2.tds.Tds.handleIOE(Tds.java:2780) at
> com.sybase.jdbc2.tds.Tds.login(Tds.java:338) at
> com.sybase.jdbc2.jdbc.SybConnection.tryLogin(SybConnection.java:213) at
> com.sybase.jdbc2.jdbc.SybConnection.regularConnect(SybConnection.java:190)
> at com.sybase.jdbc2.jdbc.SybConnection.(SybConnection.java:169) at
> com.sybase.jdbc2.jdbc.SybConnection.(SybConnection.java:122) at
> com.sybase.jdbc2.jdbc.SybDriver.connect(SybDriver.java:175) at
> java.sql.DriverManager.getConnection(DriverManager.java:517) at
> java.sql.DriverManager.getConnection(DriverManager.java:146) at
> Benchmark_sybase.query(Benchmark_sybase.java:94) at
> Benchmark_sybase.doGet(Benchmark_sybase.java:48) at
> javax.servlet.http.HttpServlet.service(HttpServlet.java:740) at
> javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at
>
org.apache.tomcat.core.ServletWrapper.handleRequest(ServletWrapper.java:503)
> at
>
org.apache.tomcat.core.ServletWrapper.handleRequest(ServletWrapper.java:597)
> at
> org.apache.tomcat.servlets.InvokerServlet.service(InvokerServlet.java:257)
> at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at
>
org.apache.tomcat.core.ServletWrapper.handleRequest(ServletWrapper.java:503)
> at org.apache.tomcat.core.ContextManager.service(ContextManager.java:559)
at
>
org.apache.tomcat.service.http.HttpConnectionHandler.processConnection(HttpC
> onnectionHandler.java:160) at
>
org.apache.tomcat.service.TcpConnectionThread.run(SimpleTcpEndpoint.java:338
> ) at java.lang.Thread.run(Thread.java:484)
>
>
>
> Case 2: same URL (URL = "jdbc:sybase:Tds:localhost:2638"), I have to
> connect the database from Sybase central in order for my program to run.
>
>
> Case 3: set URL = "jdbc:sybase:asademo"  -- I created my table in asademo
> database.
>
>    I got the following Exception.:
>
> java.sql.SQLException: JZ0D5: Error loading protocol
> com.sybase.jdbc2.asademo.asademo. at
> com.sybase.jdbc2.jdbc.ErrorMessage.raiseError(ErrorMessage.java:423) at
>
com.sybase.jdbc2.jdbc.ProtocolManager.getProtocol(ProtocolManager.java:102)
> at
com.sybase.jdbc2.jdbc.SybUrlManager.loadProtocol(SybUrlManager.java:191)
> at com.sybase.jdbc2.jdbc.SybUrlManager.init(SybUrlManager.java:133) at
> com.sybase.jdbc2.jdbc.SybUrlManager.getUrlProvider(SybUrlManager.java:110)
> at com.sybase.jdbc2.jdbc.SybDriver.connect(SybDriver.java:167) at
> java.sql.DriverManager.getConnection(DriverManager.java:517) at
> java.sql.DriverManager.getConnection(DriverManager.java:146) at
> Benchmark_sybase.query(Benchmark_sybase.java:99) at
> Benchmark_sybase.doGet(Benchmark_sybase.java:53) at
> javax.servlet.http.HttpServlet.service(HttpServlet.java:740) at
> javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at
>
org.apache.tomcat.core.ServletWrapper.handleRequest(ServletWrapper.java:503)
> at
>
org.apache.tomcat.core.ServletWrapper.handleRequest(ServletWrapper.java:597)
> at
> org.apache.tomcat.servlets.InvokerServlet.service(InvokerServlet.java:257)
> at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at
>
org.apache.tomcat.core.ServletWrapper.handleRequest(ServletWrapper.java:503)
> at org.apache.tomcat.core.ContextManager.service(ContextManager.java:559)
at
>
org.apache.tomcat.service.http.HttpConnectionHandler.processConnection(HttpC
> onnectionHandler.java:160) at
>
org.apache.tomcat.service.TcpConnectionThread.run(SimpleTcpEndpoint.java:338
> ) at java.lang.Thread.run(Thread.java:484)
>
> Thanks,
> Connie
>
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, email: [EMAIL PROTECTED]
>


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]

Reply via email to