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.

no suitable driver

2 posts in JDBC Connect (product renamed to JConnect) Last posting was on 1997-06-04 12:32:58.0Z
Alexander Spinelli Posted on 1997-06-03 20:45:49.0Z
Message-ID: <3394827D.5BCC@exmachina.com>
Date: Tue, 03 Jun 1997 16:45:49 -0400
From: Alexander Spinelli <spinelli@exmachina.com>
Organization: Air Media/Ex Machina
X-Mailer: Mozilla 3.0 (Win95; I)
MIME-Version: 1.0
Subject: no suitable driver
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Newsgroups: sybase.public.jdbcconnect
Lines: 34
Path: forums-1-dub!forums-master.sybase.com!forums.powersoft.com
Xref: forums-1-dub sybase.public.jdbcconnect:726
Article PK: 252478

I have written the simplest of apps.
It compiles fine and when I run it I get a "no suitable driver" error.
My CLASSPATH is .;c:\java\classes.zip;c:\jConnect\sybjdbc.zip;
I am running win95
I downloaded the classes about a month ago.

Here is the source:

import java.io.*;
import java.io.*;
import java.sql.*;
import com.sybase.utils.Debug;
import java.util.*;


public class jdbc_jconnect_test {

public static void main( String args[] ) {

try {

Class.forName("com.sybase.jdbc.SybDriver");
String url =
"com.jdbc:sybase:Tds:cletus.exmachina.com:5000/aml_test";

Properties props = new Properties();
props.put("user", "sa");
props.put("password", "bbsimps0ns");
Connection con = DriverManager.getConnection(url, props);

Statement stmt = con.createStatement();
ResultSet rs = stmt.executeQuery("Select Validation from
Filter_Config");

int i = 1;
while ( rs.next() ) {
String validation = rs.getString( i );
System.out.println ( validation );
i++;
}

con.close();

} catch ( SQLException sqe ) {
System.out.print( sqe.toString() );
} catch ( Exception e ) {
System.out.print( e.toString() );
}

}

}


Lance Andersen Posted on 1997-06-04 12:32:58.0Z
Message-ID: <3395607A.66CA@sybase.com>
Date: Wed, 04 Jun 1997 08:32:58 -0400
From: Lance Andersen <lancea@sybase.com>
X-Mailer: Mozilla 3.01Gold (X11; I; SunOS 5.5.1 sun4m)
MIME-Version: 1.0
To: Alexander Spinelli <spinelli@exmachina.com>
Subject: Re: no suitable driver
References: <3394827D.5BCC@exmachina.com>
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Newsgroups: sybase.public.jdbcconnect
Lines: 74
Path: forums-1-dub!forums-master.sybase.com!forums.powersoft.com
Xref: forums-1-dub sybase.public.jdbcconnect:724
Article PK: 252476

One problem I see is the URL: Here is the info from our docs:

-------------------------

Making a Connection to SQL Server


In your Java application, create a URL to connect to the jConnect
driver. There
are 3 acceptable syntaxes:


jdbc:sybase:Tds:host:port
jdbc:sybase:Tds:host:port/
jdbc:sybase:Tds:host:port/database

There is no difference in the function of the first and second
examples.

jdbc:sybase - identifies the driver.

Tds - the Sybase transfer protocol for SQL Server

host:port - the SQL Server host name and the SQL Server listening
port. See the
interfaces file $SYBASE/interfaces (on UNIX) or
%SYBASE%\ini\sql.ini (on
Windows) for the entry that your database or Open Server
application uses.
Obtain the hostname/port# from the "query" entry.

database - use named database (preceded by a slash '/')
----------------------

Also, I would set your CLASSPATH to be:

c:\%JDBC_HOME%\classes;%JAVA_HOME%\lib\classes.zip;.


Regards,

-Lance

Alexander Spinelli wrote:
>
> I have written the simplest of apps.
> It compiles fine and when I run it I get a "no suitable driver" error.
> My CLASSPATH is .;c:\java\classes.zip;c:\jConnect\sybjdbc.zip;
> I am running win95
> I downloaded the classes about a month ago.
>
> Here is the source:
>
> import java.io.*;
> import java.io.*;
> import java.sql.*;
> import com.sybase.utils.Debug;
> import java.util.*;
>
> public class jdbc_jconnect_test {
>
> public static void main( String args[] ) {
>
> try {
>
> Class.forName("com.sybase.jdbc.SybDriver");
> String url =
> "com.jdbc:sybase:Tds:cletus.exmachina.com:5000/aml_test";
>
> Properties props = new Properties();
> props.put("user", "sa");
> props.put("password", "bbsimps0ns");
> Connection con = DriverManager.getConnection(url, props);
>
> Statement stmt = con.createStatement();
> ResultSet rs = stmt.executeQuery("Select Validation from
> Filter_Config");
>
> int i = 1;
> while ( rs.next() ) {
> String validation = rs.getString( i );
> System.out.println ( validation );
> i++;
> }
>
> con.close();
>
> } catch ( SQLException sqe ) {
> System.out.print( sqe.toString() );
> } catch ( Exception e ) {
> System.out.print( e.toString() );
> }
>
> }
>
> }

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

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