Sybase NNTP forums - End Of Life (EOL)

The NNTP forums from Sybase - forums.sybase.com - are now closed.

All new questions should be directed to the appropriate forum at the SAP Community Network (SCN).

Individual products have links to the respective forums on SCN, or you can go to SCN and search for your product in the search box (upper right corner) to find your specific developer center.

Cannot connect to Sybase DB from

4 posts in JConnect version 3.0 Last posting was on 2000-05-12 11:04:03.0Z
Dan Ward Posted on 2000-05-10 21:45:05.0Z
Message-ID: <3919D861.3CD8ECE5@xmls.com>
Date: Wed, 10 May 2000 17:45:05 -0400
From: Dan Ward <dan.ward@xmls.com>
Organization: XML Solutions
X-Mailer: Mozilla 4.6 [en] (WinNT; U)
X-Accept-Language: en
MIME-Version: 1.0
Subject: Cannot connect to Sybase DB from
Content-Type: multipart/alternative; boundary="------------8C19A9C54CAD23C7F04A7F73"
Newsgroups: sybase.public.jconnect30
Lines: 248
NNTP-Posting-Host: xev.xmlclt.net 63.85.207.162
Path: forums-1-dub!forums-master.sybase.com!forums.sybase.com
Xref: forums-1-dub sybase.public.jconnect30:222
Article PK: 255768

First I run [ Start Menu \ Programs \ SyBase \ SQL Advantage ] and I choose CONNECT and I fill in these values:

Server:      Rollingstones
Login:       mick
Password:    jaggar
Client:      Rollingstones
and I get connected!  WHO-HOOO!  I can execute SQL and see the tables that I created using BAT files!

But when I try to compile and execute this JAVA code

import java.sql.DriverManager;
import java.sql.Connection;
import java.lang.ClassNotFoundException;
import java.sql.SQLException;
public class SybaseTry
{
        public static void main( String args[] )
        {
                System.out.println("Starting!");
 
                String driver="com.sybase.jdbc2.jdbc.SybDriver";
                String dsn="jdbc:sybase:Tds:rollingstones:5000";
                String dbUserName="mick";
                String dbPassword="jaggar";
                Connection con=null;
 
                try
                {
                        Class.forName(driver);
                        con = DriverManager.getConnection(dsn, dbUserName, dbPassword);
                }
                catch (ClassNotFoundException cnfx)
                {
                        cnfx.printStackTrace();
                        System.exit(0);
                }
                catch (SQLException sqlx)
                {
                        sqlx.printStackTrace();
                        System.exit(0);
                }
 
                System.out.println("Completed!");
        }
 
}//END SybaseTry
I get this:
G:\temp>d:\jdk1.2.2\bin\javac.exe SybaseTry.java

G:\temp>d:\jdk1.2.2\bin\java.exe SybaseTry
Starting!
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, Compiled Code)
        at com.sybase.jdbc2.jdbc.SybConnection.regularConnect(SybConnection.java:190)
        at com.sybase.jdbc2.jdbc.SybConnection.<init>(SybConnection.java:169)
        at com.sybase.jdbc2.jdbc.SybConnection.<init>(SybConnection.java:122)
        at com.sybase.jdbc2.jdbc.SybDriver.connect(SybDriver.java:175)
        at java.sql.DriverManager.getConnection(DriverManager.java:457)
        at java.sql.DriverManager.getConnection(DriverManager.java:137)
        at SybaseTry.main(SybaseTry.java:29)

G:\temp>


Any suggestions?
 
 

--
Book'em, Dano.
                                                                    What's the charge?
"MURDER ONE"
 
 


Lance Andersen Posted on 2000-05-11 11:36:07.0Z
Message-ID: <391A9B27.D6669DFF@sybase.com>
Date: Thu, 11 May 2000 07:36:07 -0400
From: Lance Andersen <lancea@sybase.com>
X-Mailer: Mozilla 4.72 [en] (X11; U; SunOS 5.7 sun4u)
X-Accept-Language: en
MIME-Version: 1.0
Subject: Re: Cannot connect to Sybase DB from
References: <3919D861.3CD8ECE5@xmls.com>
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Newsgroups: sybase.public.jconnect30
Lines: 95
NNTP-Posting-Host: alder.sybase.com 157.133.125.15
Path: forums-1-dub!forums-master.sybase.com!forums.sybase.com
Xref: forums-1-dub sybase.public.jconnect30:221
Article PK: 254569

Connection refused indicates the hostname and or port is incorrect.

Dan Ward wrote:
>
> First I run [ Start Menu \ Programs \ SyBase \ SQL Advantage ] and I
> choose CONNECT and I fill in these values:
>
> Server: Rollingstones
> Login: mick
> Password: jaggar
> Client: Rollingstones
>
> and I get connected! WHO-HOOO! I can execute SQL and see the tables
> that I created using BAT files!
>
> But when I try to compile and execute this JAVA code
>
> import java.sql.DriverManager;
> import java.sql.Connection;
> import java.lang.ClassNotFoundException;
> import java.sql.SQLException;
> public class SybaseTry
> {
> public static void main( String args[] )
> {
> System.out.println("Starting!");
>
> String
> driver="com.sybase.jdbc2.jdbc.SybDriver";
> String
> dsn="jdbc:sybase:Tds:rollingstones:5000";
> String dbUserName="mick";
> String dbPassword="jaggar";
> Connection con=null;
>
> try
> {
> Class.forName(driver);
> con =
> DriverManager.getConnection(dsn, dbUserName, dbPassword);
> }
> catch (ClassNotFoundException cnfx)
> {
> cnfx.printStackTrace();
> System.exit(0);
> }
> catch (SQLException sqlx)
> {
> sqlx.printStackTrace();
> System.exit(0);
> }
>
> System.out.println("Completed!");
> }
>
> }//END SybaseTry
>
> I get this:
>
> G:\temp>d:\jdk1.2.2\bin\javac.exe SybaseTry.java
>
> G:\temp>d:\jdk1.2.2\bin\java.exe SybaseTry
> Starting!
> 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,
> Compiled Code)
> at
> com.sybase.jdbc2.jdbc.SybConnection.regularConnect(SybConnection.java:190)
>
> at
> com.sybase.jdbc2.jdbc.SybConnection.<init>(SybConnection.java:169)
>
> at
> com.sybase.jdbc2.jdbc.SybConnection.<init>(SybConnection.java:122)
>
> at
> com.sybase.jdbc2.jdbc.SybDriver.connect(SybDriver.java:175)
> at
> java.sql.DriverManager.getConnection(DriverManager.java:457)
>
> at
> java.sql.DriverManager.getConnection(DriverManager.java:137)
>
> at SybaseTry.main(SybaseTry.java:29)
>
> G:\temp>
>
> Any suggestions?
>
>
>
> --
> Book'em, Dano.
>
> What's the charge?
> "MURDER ONE"
>
>

--
===============================================================================
Lance J. Andersen Email: lancea@sybase.com
Sybase Product Support Engineering Phone:(781) 564-6336
77 South Bedford Street Fax: (781) 564-7001
Burlington, MA 01803

The Dark Knight Returns!!! Let's Go Penguins!!!
===============================================================================


Dan Ward Posted on 2000-05-11 14:50:59.0Z
Message-ID: <391AC8D3.8492A4FD@xmls.com>
Date: Thu, 11 May 2000 10:50:59 -0400
From: Dan Ward <dan.ward@xmls.com>
Organization: XML Solutions
X-Mailer: Mozilla 4.6 [en] (WinNT; U)
X-Accept-Language: en
MIME-Version: 1.0
Subject: Re: Cannot connect to Sybase DB from
References: <3919D861.3CD8ECE5@xmls.com> <391A9B27.D6669DFF@sybase.com>
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Newsgroups: sybase.public.jconnect30
Lines: 113
NNTP-Posting-Host: xev.xmlclt.net 63.85.207.162
Path: forums-1-dub!forums-master.sybase.com!forums.sybase.com
Xref: forums-1-dub sybase.public.jconnect30:220
Article PK: 256636

Since I can connect from SQL Advantage, the hostname is correct. I am damned if I
can find any references to where the PORT number is set. I have tried all the PORT
numbers used in the example programs that came with JConnect. What is the default
port number from the INSTALL?

Lance Andersen wrote:

> Connection refused indicates the hostname and or port is incorrect.
>
> Dan Ward wrote:
> >
> > First I run [ Start Menu \ Programs \ SyBase \ SQL Advantage ] and I
> > choose CONNECT and I fill in these values:
> >
> > Server: Rollingstones
> > Login: mick
> > Password: jaggar
> > Client: Rollingstones
> >
> > and I get connected! WHO-HOOO! I can execute SQL and see the tables
> > that I created using BAT files!
> >
> > But when I try to compile and execute this JAVA code
> >
> > import java.sql.DriverManager;
> > import java.sql.Connection;
> > import java.lang.ClassNotFoundException;
> > import java.sql.SQLException;
> > public class SybaseTry
> > {
> > public static void main( String args[] )
> > {
> > System.out.println("Starting!");
> >
> > String
> > driver="com.sybase.jdbc2.jdbc.SybDriver";
> > String
> > dsn="jdbc:sybase:Tds:rollingstones:5000";
> > String dbUserName="mick";
> > String dbPassword="jaggar";
> > Connection con=null;
> >
> > try
> > {
> > Class.forName(driver);
> > con =
> > DriverManager.getConnection(dsn, dbUserName, dbPassword);
> > }
> > catch (ClassNotFoundException cnfx)
> > {
> > cnfx.printStackTrace();
> > System.exit(0);
> > }
> > catch (SQLException sqlx)
> > {
> > sqlx.printStackTrace();
> > System.exit(0);
> > }
> >
> > System.out.println("Completed!");
> > }
> >
> > }//END SybaseTry
> >
> > I get this:
> >
> > G:\temp>d:\jdk1.2.2\bin\javac.exe SybaseTry.java
> >
> > G:\temp>d:\jdk1.2.2\bin\java.exe SybaseTry
> > Starting!
> > 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,
> > Compiled Code)
> > at
> > com.sybase.jdbc2.jdbc.SybConnection.regularConnect(SybConnection.java:190)
> >
> > at
> > com.sybase.jdbc2.jdbc.SybConnection.<init>(SybConnection.java:169)
> >
> > at
> > com.sybase.jdbc2.jdbc.SybConnection.<init>(SybConnection.java:122)
> >
> > at
> > com.sybase.jdbc2.jdbc.SybDriver.connect(SybDriver.java:175)
> > at
> > java.sql.DriverManager.getConnection(DriverManager.java:457)
> >
> > at
> > java.sql.DriverManager.getConnection(DriverManager.java:137)
> >
> > at SybaseTry.main(SybaseTry.java:29)
> >
> > G:\temp>
> >
> > Any suggestions?
> >
> >
> >
> > --
> > Book'em, Dano.
> >
> > What's the charge?
> > "MURDER ONE"
> >
> >
>
> --
> ===============================================================================
> Lance J. Andersen Email: lancea@sybase.com
> Sybase Product Support Engineering Phone:(781) 564-6336
> 77 South Bedford Street Fax: (781) 564-7001
> Burlington, MA 01803
>
> The Dark Knight Returns!!! Let's Go Penguins!!!
> ===============================================================================

--
Book'em, Dano.
What's the
charge?
"MURDER ONE"
--
Dan Ward - Software Engineer - XMLSolutions - (704) 849-2704


Lance Andersen Posted on 2000-05-12 11:04:03.0Z
Message-ID: <391BE523.6934470D@sybase.com>
Date: Fri, 12 May 2000 07:04:03 -0400
From: Lance Andersen <lancea@sybase.com>
X-Mailer: Mozilla 4.72 [en] (X11; U; SunOS 5.7 sun4u)
X-Accept-Language: en
MIME-Version: 1.0
Subject: Re: Cannot connect to Sybase DB from
References: <3919D861.3CD8ECE5@xmls.com> <391A9B27.D6669DFF@sybase.com> <391AC8D3.8492A4FD@xmls.com>
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Newsgroups: sybase.public.jconnect30
Lines: 136
NNTP-Posting-Host: alder.sybase.com 157.133.125.15
Path: forums-1-dub!forums-master.sybase.com!forums.sybase.com
Xref: forums-1-dub sybase.public.jconnect30:219
Article PK: 256622

SQL Advantage uses an interface entry which is in the sql.ini file.



- Your ASE must have a tcp listener and if it does you can look at your
sql.ini to determine what port the server is listening on.

Dan Ward wrote:
>
> Since I can connect from SQL Advantage, the hostname is correct. I am damned if I
> can find any references to where the PORT number is set. I have tried all the PORT
> numbers used in the example programs that came with JConnect. What is the default
> port number from the INSTALL?
>
> Lance Andersen wrote:
>
> > Connection refused indicates the hostname and or port is incorrect.
> >
> > Dan Ward wrote:
> > >
> > > First I run [ Start Menu \ Programs \ SyBase \ SQL Advantage ] and I
> > > choose CONNECT and I fill in these values:
> > >
> > > Server: Rollingstones
> > > Login: mick
> > > Password: jaggar
> > > Client: Rollingstones
> > >
> > > and I get connected! WHO-HOOO! I can execute SQL and see the tables
> > > that I created using BAT files!
> > >
> > > But when I try to compile and execute this JAVA code
> > >
> > > import java.sql.DriverManager;
> > > import java.sql.Connection;
> > > import java.lang.ClassNotFoundException;
> > > import java.sql.SQLException;
> > > public class SybaseTry
> > > {
> > > public static void main( String args[] )
> > > {
> > > System.out.println("Starting!");
> > >
> > > String
> > > driver="com.sybase.jdbc2.jdbc.SybDriver";
> > > String
> > > dsn="jdbc:sybase:Tds:rollingstones:5000";
> > > String dbUserName="mick";
> > > String dbPassword="jaggar";
> > > Connection con=null;
> > >
> > > try
> > > {
> > > Class.forName(driver);
> > > con =
> > > DriverManager.getConnection(dsn, dbUserName, dbPassword);
> > > }
> > > catch (ClassNotFoundException cnfx)
> > > {
> > > cnfx.printStackTrace();
> > > System.exit(0);
> > > }
> > > catch (SQLException sqlx)
> > > {
> > > sqlx.printStackTrace();
> > > System.exit(0);
> > > }
> > >
> > > System.out.println("Completed!");
> > > }
> > >
> > > }//END SybaseTry
> > >
> > > I get this:
> > >
> > > G:\temp>d:\jdk1.2.2\bin\javac.exe SybaseTry.java
> > >
> > > G:\temp>d:\jdk1.2.2\bin\java.exe SybaseTry
> > > Starting!
> > > 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,
> > > Compiled Code)
> > > at
> > > com.sybase.jdbc2.jdbc.SybConnection.regularConnect(SybConnection.java:190)
> > >
> > > at
> > > com.sybase.jdbc2.jdbc.SybConnection.<init>(SybConnection.java:169)
> > >
> > > at
> > > com.sybase.jdbc2.jdbc.SybConnection.<init>(SybConnection.java:122)
> > >
> > > at
> > > com.sybase.jdbc2.jdbc.SybDriver.connect(SybDriver.java:175)
> > > at
> > > java.sql.DriverManager.getConnection(DriverManager.java:457)
> > >
> > > at
> > > java.sql.DriverManager.getConnection(DriverManager.java:137)
> > >
> > > at SybaseTry.main(SybaseTry.java:29)
> > >
> > > G:\temp>
> > >
> > > Any suggestions?
> > >
> > >
> > >
> > > --
> > > Book'em, Dano.
> > >
> > > What's the charge?
> > > "MURDER ONE"
> > >
> > >
> >
> > --
> > ===============================================================================
> > Lance J. Andersen Email: lancea@sybase.com
> > Sybase Product Support Engineering Phone:(781) 564-6336
> > 77 South Bedford Street Fax: (781) 564-7001
> > Burlington, MA 01803
> >
> > The Dark Knight Returns!!! Let's Go Penguins!!!
> > ===============================================================================
>
> --
> Book'em, Dano.
> What's the
> charge?
> "MURDER ONE"
> --
> Dan Ward - Software Engineer - XMLSolutions - (704) 849-2704

--
===============================================================================
Lance J. Andersen Email: lancea@sybase.com
Sybase Product Support Engineering Phone:(781) 564-6336
77 South Bedford Street Fax: (781) 564-7001
Burlington, MA 01803

The Dark Knight Returns!!! Let's Go Penguins!!!
===============================================================================