error code 08001 accompanied by "java.sql.SQLException: No suitable driver"

Adrian Hill adrian.hill at nrm-internet.net
Thu Apr 19 04:08:56 EDT 2001


Just had a quick look at your code. Why are you using three database
drivers? That may be the problem...

void getRecords(String SQL)  {
try {
	Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
	Class.forName("com.internetcds.jdbc.tds.SybaseDriver");
	Class.forName("com.internetcds.jdbc.tds.Driver");
	} catch (ClassNotFoundException fg) {
		StatusLabel.setText("Failed to Load Driver: "+fg.toString());
		System.out.println("Failed to Load Driver: "+fg.toString());
		}

I'd use this code to connect to a MS SQL Server 7 database...

			Class.forName("com.inet.tds.TdsDriver");
			Connection con =
DriverManager.getConnection("jdbc:inetdae7://127.0.0.1/someDatabase", "sa",
"");
			Statement stmt = con.createStatement();

			// Return the raw ResultSet.
			return stmt.executeQuery("SELECT * FROM someTable");

Hope this helps,


Adrian Hill.


> -----Original Message-----
> From: bounce-freetds-129830 at franklin.oit.unc.edu
> [mailto:bounce-freetds-129830 at franklin.oit.unc.edu]On Behalf Of Brown,
> John
> Sent: Thursday, April 19, 2001 2:18 AM
> To: TDS Development Group
> Subject: [freetds] error code 08001 accompanied by
> "java.sql.SQLException: No suitable driver"
>
>
> I'm trying to write an applet to connect to a Sysbase Sql Anywhere
> Database on an IIs (NT4) server - but so far no luck.  Here's the errors I
> get:
>
> (error/vendor code) :
> "08001"
>
> accompanied by :
> "java.sql.SQLException: No suitable driver"




More information about the FreeTDS mailing list