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 On IE 3.0

5 posts in JDBC Connect (product renamed to JConnect) Last posting was on 1997-07-31 00:07:17.0Z
Nigel Heywood Posted on 1997-07-10 14:55:40.0Z
From: "Nigel Heywood" <nigelh@arendeeco.com>
Subject: No Suitable Driver On IE 3.0
Message-ID: <01bc8d49$b730f7e0$5896d1cc@nigel>
X-Newsreader: Microsoft Internet News 4.70.1161
Newsgroups: sybase.public.jdbcconnect
Date: Thu, 10 Jul 1997 10:55:40 -0400
Lines: 248
Path: forums-1-dub!forums-master.sybase.com!forums.powersoft.com
Xref: forums-1-dub sybase.public.jdbcconnect:564
Article PK: 252316

Hi,
I'm also having a problem with "No Suitable Driver" ONLY on IE 3.X
(including the latest version 3.02). I am using the following with
jConnect:

Microsoft's IIS 3.0
NT 4.0
Sybase 11.0

I am using your sample isql.java applet to do a simple select. The applet
works on Netscape but not Internet Explorer. I have the CLASSPATH set to
the following:

SET
CLASSPATH=c:\INetPub\wwwroot\syb102.zip;c:\INetPub\wwwroot\classes.zip;c:\IN
etPub\wwwroot

My Home Web directory is c:\INetPub\wwwroot and I have all java class
files expanded in subdirectories below it.

Here is my source code for isql.java using Java Version 1.02

import java.awt.*;
import java.net.*;
import java.io.*;
import jdbc.sql.*;
import jdbc.math.*;
import jdbc.sybase.utils.Debug; // Sybase internal debugging class
import jdbc.sybase.jdbc.*;
import java.util.*; // Properties
import java.applet.*;

public class Applet1 extends Applet {

Label _queryLbl;
TextField _query;
TextField _status;
Label _resultLbl;
TextArea _result;
Button _goButton;
Panel _p;
Color _bkgrdColor = new Color(207,207,207);


Connection _con;
Statement _stmt;
boolean _queryInProgress = false;

public Applet1()
{
setLayout(new BorderLayout());
setBackground(_bkgrdColor);
_p = new Panel();
add("Center", _p);
_p.setBackground(_bkgrdColor);
_p.setFont(new Font("Dialog", Font.PLAIN, 12));

_queryLbl = new Label("Query:");
_query = new TextField("none");
_query.setBackground(Color.white);
_goButton = new Button("Go");
_resultLbl = new Label("Results:");
_result = new TextArea(15,60);
_result.setEditable(false);
_result.setBackground(Color.white);
/*
** GridBagLayout version
*/
GridBagLayout g = new GridBagLayout();
GridBagConstraints gbCon = new GridBagConstraints();
gbCon.anchor = GridBagConstraints.CENTER;
gbCon.fill = GridBagConstraints.BOTH;
gbCon.gridheight = 1;
gbCon.gridwidth = 1;
gbCon.ipadx = 0;
gbCon.ipady = 0;
gbCon.weightx = 1.0;
gbCon.weighty = 1.0;

gbCon.gridx = 0;
gbCon.gridy = 0;
gbCon.insets = new Insets(5,5,0,5);
g.setConstraints(_queryLbl, gbCon);

gbCon.gridy = 1;
gbCon.insets = new Insets(0,5,5,5);
g.setConstraints(_query, gbCon);

gbCon.gridy = 2;
gbCon.insets = new Insets(5,250,0,250);
g.setConstraints(_goButton, gbCon);

gbCon.gridy = 3;
gbCon.insets = new Insets(5,5,0,5);
g.setConstraints(_resultLbl, gbCon);

gbCon.gridy = 4;
gbCon.insets = new Insets(0,5,5,5);
g.setConstraints(_result, gbCon);

_p.setLayout(g);

/*
** GridLayout version
*/
// _p.setLayout(new GridLayout(5,1,5,5));

_p.add( _queryLbl);
_p.add( _query);
_p.add( _goButton);
_p.add( _resultLbl);
_p.add( _result);
}

/**
* handleEvent may be overridden by subclasses that want to get
* notified when AWT events that are sent by the gui components.
* The return value should be true for handled events, and
* super.handleEvent should be called for unhandled events.
* If super.handleEvent is not called, then the specific event
* handling methods will not be called.
*/
public boolean action(Event evt, Object arg)
{
if ("Go".equals(arg))
{
if (!_queryInProgress)
{
_queryInProgress = true;
_result.setForeground(Color.black);
doQuery();
_queryInProgress = false;
}
else
{
showStatus("Query in progress. Please wait...");
}
return true;
}
return false;
}

public void init()
{
// turn on debugging (timing problem causes hang w/out it
String debugClasses = getParameter("debug");
if (debugClasses != null)
{
try
{
Debug.debug(true, debugClasses, System.out);
}
catch (IOException ioe)
{
displayError("Unable to open debug class. "
+ ioe.toString());
return;
}
}
// Force the Sybase jdbc driver to be loaded
try
{
Class.forName("jdbc.sybase.jdbc.SybDriver");
}
catch (ClassNotFoundException cnfe)
{
displayError("Unable to load the Sybase JDBC driver. "
+ cnfe.toString());
cnfe.printStackTrace(System.out);
return;
}
}


public void start()
{
int timeout;
int test;

String urlBase = "jdbc:sybase:Tds:";
String host = getParameter("host");
String port = getParameter("port");
String url = urlBase + host + ":" + port;
String timeStr = getParameter("timeout");

test =1;
if (null == timeStr)
{
timeout = 0;
}
else
{
timeout = (new Integer(timeStr)).intValue();
}
test =test +1;
String usedb = getParameter("usedb");
_query.setText(getParameter("query"));
showStatus("Trying to connect to: " + url);
test =test +1;

try
{
String proxy = getParameter("proxy");
Properties info = new Properties();
test =test +1;
info.put("user", "sa");
info.put("password", "");
test =test +1;
if (proxy != null)
{
info.put("proxy", proxy);
}
test =test +1;
// Connect to the database at that URL.
DriverManager.setLoginTimeout(timeout);
test =test +1;
showStatus("URL Connection " + url);
test =test +1;
_con = DriverManager.getConnection(url, info);
test =test +1;
_stmt = _con.createStatement();
test =test +1;
}
catch (SQLException sqle)
{
showStatus(sqle.toString() + test + " " + url + " SQL Error");
displayError(sqle.toString() + test + " " + url + " SQL
Error");
return;
}
catch (Exception e)
{
catchEx(e);
return;
}
try
{
// Solaris sometimes throws NullPointerException here, but
_stmt != null. ???
_stmt.setQueryTimeout(timeout);
// try to use this db
showStatus("Going to database: " + usedb);
boolean restype = _stmt.execute("use " + usedb);
if (restype)
{
// not expecting results!
showStatus("Unexpected results from USE");
_stmt.cancel();
}
}
catch (SQLException sqle)
{
catchSQLEx(sqle);
return;
}
catch (Exception e)
{
catchEx(e);
return;
}
}
public void stop()
{
try
{
showStatus("Closing statement");
if (_stmt != null)
{
_stmt.close();
_stmt = null;
}
showStatus("Closing connection");
if (_con != null)
{
_con.close();
_con = null;
}
}
catch (Exception e)
{
catchEx(e);
}
}
private void doQuery()
{
try
{
showStatus("Sending query: " + _query);

ResultSet rs = _stmt.executeQuery(_query.getText());
ResultSetMetaData rsmd = rs.getMetaData();
int numColumns = rsmd.getColumnCount();
StringBuffer column = new StringBuffer("Columns:");
for (int i = 1; i <= numColumns; i++)
{
column.append("\t" + rsmd.getColumnName(i));
}
_result.setText(column.toString());
for(int rowNum = 1; rs.next(); rowNum++)
{
column = new StringBuffer("[ " + rowNum + "]");
for (int i = 1; i <= numColumns; i++)
{
column.append("\t" + rs.getString(i));
}
_result.appendText("\n" + column.toString());
}
}
catch (SQLException sqle)
{
catchSQLEx(sqle);
return;
}
catch (Exception e)
{
catchEx(e);
return;
}
}
private void catchSQLEx(SQLException sqle)
{
displayError(sqle.toString() + " Cancelling...");
try
{
_stmt.cancel();
}
catch (SQLException sqle2)
{
displayError(sqle2.toString() + " after " + sqle.toString());
}
}
private void catchEx(Exception e)
{
e.printStackTrace(System.out);
displayError("Unexpected Exception: " + e.toString());
}
private void displayError(String str)
{
_result.setText(str);
_result.setForeground(Color.red);
// showStatus(str.toString() + " Restart connection.");
}
}


David Clegg Posted on 1997-07-30 21:03:16.0Z
Message-ID: <33DFAC14.6B67319@sybase.com>
Date: Wed, 30 Jul 1997 14:03:16 -0700
From: David Clegg <davec@sybase.com>
X-Mailer: Mozilla 3.01 (X11; I; Linux 1.2.13 i586)
MIME-Version: 1.0
To: Nigel Heywood <nigelh@arendeeco.com>
Subject: Re: No Suitable Driver On IE 3.0
References: <01bc8d49$b730f7e0$5896d1cc@nigel>
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Newsgroups: sybase.public.jdbcconnect
Lines: 27
Path: forums-1-dub!forums-master.sybase.com!forums.powersoft.com
Xref: forums-1-dub sybase.public.jdbcconnect:438
Article PK: 252190


Nigel Heywood wrote:
>
> Hi,
> I'm also having a problem with "No Suitable Driver" ONLY on IE 3.X
> (including the latest version 3.02). I am using the following with
> jConnect:
>
> Microsoft's IIS 3.0
> NT 4.0
> Sybase 11.0
>
> I am using your sample isql.java applet to do a simple select. The applet
> works on Netscape but not Internet Explorer.

...
This problem is addressed in more recent versions of the sample
applet. A bug in I.E. causes the driver not to get loaded right
when you use the Class.forName only. Change your loading to:

> // Force the Sybase jdbc driver to be loaded
Class c = null;
> try
> {
> c = class.forName("jdbc.sybase.jdbc.SybDriver");
> }
> catch (ClassNotFoundException cnfe)
> {
> displayError("Unable to load the Sybase JDBC driver. "
> + cnfe.toString());
> cnfe.printStackTrace(System.out);
> return;
> }
DriverManager.registerDriver(c.newInstance());


David Lance Wolf Posted on 1997-07-31 00:07:17.0Z
Message-ID: <33DFD735.F56F6D3B@sybase.com>
Date: Wed, 30 Jul 1997 17:07:17 -0700
From: David Lance Wolf <dwolf@sybase.com>
X-Mailer: Mozilla 4.01 [en] (Win95; U)
MIME-Version: 1.0
Subject: Re: No Suitable Driver On IE 3.0
X-Priority: 3 (Normal)
References: <01bc8d49$b730f7e0$5896d1cc@nigel> <33DFAC14.6B67319@sybase.com>
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Newsgroups: sybase.public.jdbcconnect
Lines: 35
Path: forums-1-dub!forums-master.sybase.com!forums.powersoft.com
Xref: forums-1-dub sybase.public.jdbcconnect:434
Article PK: 252185

David-

Am I to understand this IE3 bug manifests itself ONLY when I register
the driver using Class.forName, NOT if I have jdbc.drivers set in the
Properties?

Dave Wolf
Sybase Professional Services

David Clegg wrote:

> Nigel Heywood wrote:
> >
> > Hi,
> > I'm also having a problem with "No Suitable Driver" ONLY on IE 3.X
> > (including the latest version 3.02). I am using the following with
> > jConnect:
> >
> > Microsoft's IIS 3.0
> > NT 4.0
> > Sybase 11.0
> >
> > I am using your sample isql.java applet to do a simple
> select. The applet
> > works on Netscape but not Internet Explorer.
> ...
> This problem is addressed in more recent versions of the sample
> applet. A bug in I.E. causes the driver not to get loaded right
> when you use the Class.forName only. Change your loading to:
>
> > // Force the Sybase jdbc driver to be loaded
> Class c = null;
> > try
> > {
> > c = class.forName("jdbc.sybase.jdbc.SybDriver");
> > }
> > catch (ClassNotFoundException cnfe)
> > {
> > displayError("Unable to load the Sybase JDBC driver. "
> > + cnfe.toString());
> > cnfe.printStackTrace(System.out);
> > return;
> > }
> DriverManager.registerDriver(c.newInstance());


David Clegg Posted on 1997-07-30 22:16:55.0Z
Message-ID: <33DFBD57.5FBCA3C8@sybase.com>
Date: Wed, 30 Jul 1997 15:16:55 -0700
From: David Clegg <davec@sybase.com>
X-Mailer: Mozilla 3.01 (X11; I; Linux 1.2.13 i586)
MIME-Version: 1.0
To: David Lance Wolf <dwolf@sybase.com>
Subject: Re: No Suitable Driver On IE 3.0
References: <01bc8d49$b730f7e0$5896d1cc@nigel> <33DFAC14.6B67319@sybase.com> <33DFD735.F56F6D3B@sybase.com>
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Newsgroups: sybase.public.jdbcconnect
Lines: 47
Path: forums-1-dub!forums-master.sybase.com!forums.powersoft.com
Xref: forums-1-dub sybase.public.jdbcconnect:424
Article PK: 252177

I think that DriverManager just does a Class.forName() to - for each
driver class listed in the jdbc.driver property. BUT since the
DriverManager we are using in the IE case has to be
jdbc.sql.DriverManager in the JDK1.0.2 environment, it cannot access
the jdbc.drivers property (applet security restriction).

I think we have seen this same bug with Netscape on win95 too.

dave

> David-
>
> Am I to understand this IE3 bug manifests itself ONLY when I register
> the driver using Class.forName, NOT if I have jdbc.drivers set in the
> Properties?
>
> Dave Wolf
> Sybase Professional Services
>
> David Clegg wrote:
>
> > Nigel Heywood wrote:
> > >
> > > Hi,
> > > I'm also having a problem with "No Suitable Driver" ONLY on IE 3.X
> > > (including the latest version 3.02). I am using the following with
> > > jConnect:
> > >
> > > Microsoft's IIS 3.0
> > > NT 4.0
> > > Sybase 11.0
> > >
> > > I am using your sample isql.java applet to do a simple
> > select. The applet
> > > works on Netscape but not Internet Explorer.
> > ...
> > This problem is addressed in more recent versions of the sample
> > applet. A bug in I.E. causes the driver not to get loaded right
> > when you use the Class.forName only. Change your loading to:
> >
> > > // Force the Sybase jdbc driver to be loaded
> > Class c = null;
> > > try
> > > {
> > > c = class.forName("jdbc.sybase.jdbc.SybDriver");
> > > }
> > > catch (ClassNotFoundException cnfe)
> > > {
> > > displayError("Unable to load the Sybase JDBC driver. "
> > > + cnfe.toString());
> > > cnfe.printStackTrace(System.out);
> > > return;
> > > }
> > DriverManager.registerDriver(c.newInstance());


Sivagnanam Easwar Posted on 1997-07-26 23:01:28.0Z
Message-ID: <33DA81C8.504E52E1@worldnet.att.net>
Date: Sat, 26 Jul 1997 16:01:28 -0700
From: Sivagnanam Easwar <easwar@worldnet.att.net>
Reply-To: easwar@worldnet.att.net
X-Mailer: Mozilla 4.01 [en] (WinNT; U)
MIME-Version: 1.0
CC: "easwar@worldnet.att.net" <easwar@worldnet.att.net>
Subject: Connect problem using jconnect
X-Priority: 3 (Normal)
References: <01bc8d49$b730f7e0$5896d1cc@nigel>
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Newsgroups: sybase.public.jdbcconnect
Lines: 39
Path: forums-1-dub!forums-master.sybase.com!forums.powersoft.com
Xref: forums-1-dub sybase.public.jdbcconnect:462
Article PK: 252214

Hi:
I seem to have a problem trying to connect to my database whenever I
dial into my ISP and have
an internet connection on. Once I disconnect from the internet,
everything works fine and I am able
to connect to my database through jconnect. BTW, when my internet
connection is on, I am able
to connect to the server that sybase has set up for testing purposes.

Am I missing something or have I ignored setting up something. Any help
will be appreciated.

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

Info regarding my setup:
OS: NT 4.0
JDK version: 1.1.2
Sybase version: 10
-----------------------------------------------------------------------------------------------

Error message I am getting:

Sybase jConnect (TM) for JDBC (TM) 2.1 Development and Unsupported
Version
It is an unsupported product and is not intended for deployment. It
does not i
nclude free technical support. You can purchase technical support on
an annual
or pay-per-issue basis. Discussion Newsgroup is available on
www.sybase.com.
For additional information on services or run-time license, please
check Sybase
website or call 1-800-8-SYBASE or +1-510-922-3500 outside of the USA
and Canad
a.

Copyright 1997 Sybase, Inc.
All Rights Reserved

*** SQLException caught ***

SQLState: JZ0I4
Message: An IO exception was caught from a lower layer and re-thrown.:
java.io.
IOException: Connection failed to 'ASHAN:5000'
Vendor: 0