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.

SQLException No suitable driver

3 posts in JConnect version 3.0 Last posting was on 2001-03-13 13:04:33.0Z
Anonymous Posted on 2000-12-11 21:27:18.0Z
From: Anonymous@sybase.com
Date: Mon, 11 Dec 2000 16:27:18 -0500
Newsgroups: sybase.public.jconnect30
Subject: SQLException No suitable driver
Message-ID: <7BC815E6745228D10075DB4B852569B2.0075DB5D852569B2@webforums>
Lines: 37
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Path: forums-1-dub!forums-master.sybase.com!forums.sybase.com!webforums.sybase.com!news
Xref: forums-1-dub sybase.public.jconnect30:202
Article PK: 255681

My question has nothing to do with jconnect, however I would appreciat if
someone could help me.


I am getting this SQLException
No suitable driver found.

I am using java2 on a solaris box, and connecting to ASE version 1103

when I run the code below.

private String jdbcUrl = "jdbc.sybase.Tds:host:port/database";

void setUpConnection()
{
try
{
Class.forName("com.sybase.jdbc.SybDriver");
con = DriverManager.getConnection(jdbcUrl, "user", "passwd");
}
catch ( SQLException soe)
{
System.err.println(" The error msg generated at getConnect
is " + soe.getMessage());
}
catch ( ClassNotFoundException coe)
{
System.err.println("Class not found " + coe.getMessage());
}
}

Thanks

Ade


lance.andersen Posted on 2001-03-13 13:04:33.0Z
From: lance.andersen@sun.com
Date: Tue, 13 Mar 2001 08:04:33 -0500
Newsgroups: sybase.public.jconnect30
Subject: Re: SQLException No suitable driver
Message-ID: <2753C25B3EA2B9570047D3D385256A0E.004C967D852569B9@webforums>
References: <7BC815E6745228D10075DB4B852569B2.0075DB5D852569B2@webforums>
Lines: 10
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Path: forums-1-dub!forums-master.sybase.com!forums.sybase.com!webforums.sybase.com!news
Xref: forums-1-dub sybase.public.jconnect30:192
Article PK: 254558

If you have spaces in your path to jConnect, make sure
you enclose your classpath in quotes.


Also, make sure you are using jConnect 4.x if you are using
com.sybase.jdbc.SybDriver.


com.sybase.jdbc2.jdbc.SybDriver is what you use with jConnect
5.x and requires jconn2.jar in your classpath


OctoberX Posted on 2001-01-16 00:27:14.0Z
From: OctoberX
Date: Mon, 15 Jan 2001 19:27:14 -0500
Newsgroups: sybase.public.jconnect30
Subject: Re: SQLException No suitable driver
Message-ID: <65098276654FEFE400027E4C852569D6.004C967D852569B9@webforums>
References: <7BC815E6745228D10075DB4B852569B2.0075DB5D852569B2@webforums>
Lines: 33
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Path: forums-1-dub!forums-master.sybase.com!forums.sybase.com!webforums.sybase.com!news
Xref: forums-1-dub sybase.public.jconnect30:198
Article PK: 256606

I wish I could help. I'm also having the same problems, however, they are
on a Win system.

One thing I can tell you is that you are getting a jconnect error. The
Class.forName() is not loading the SybDriver.

I have changed you code below to what it should be in the correct catch
order... I'm also looking for a solution.


private String jdbcUrl = "jdbc.sybase.Tds:host:port/database";

void setUpConnection()
{
try
{
Class.forName("com.sybase.jdbc.SybDriver");
}
catch ( ClassNotFoundException coe)
{
System.err.println("Class not found " + coe.getMessage());
}

try{
con = DriverManager.getConnection(jdbcUrl, "user", "passwd");
}
catch ( SQLException soe)
{
System.err.println(" The error msg generated at getConnect
is " + soe.getMessage());
}

}