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.

How Do I Force JConnect driver to be used?

2 posts in JDBC Connect (product renamed to JConnect) Last posting was on 1997-04-16 17:14:44.0Z
Edward Bauer Posted on 1997-04-14 13:00:40.0Z
Message-ID: <33522A78.1A46@stsci.edu>
Date: Mon, 14 Apr 1997 09:00:40 -0400
From: Edward Bauer <bauer@stsci.edu>
X-Mailer: Mozilla 3.01 (X11; I; SunOS 5.5 sun4m)
MIME-Version: 1.0
CC: bauer@stsci.edu
Subject: How Do I Force JConnect driver to be used?
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Newsgroups: sybase.public.jdbcconnect
Lines: 13
Path: forums-1-dub!forums-master.sybase.com!forums.powersoft.com
Xref: forums-1-dub sybase.public.jdbcconnect:1024
Article PK: 252774

Suppose I have an application that loads a bunch of JDBC drivers and
talks to multiple databases from different vendors (Sybase, Oracle,
...).

More than one of the drivers can can talk to a Sybase database.

How do I force the DriverManager to use the jConnect driver over the
other ones??? The JDBC API says you can force it but I do not see how.
I could deregister all drivers but the jConnect but that would defeat
other parts of the application.

Any ideas?

Ted


David Clegg Posted on 1997-04-16 17:14:44.0Z
Message-ID: <33550904.18137D6B@sybase.com>
Date: Wed, 16 Apr 1997 10:14:44 -0700
From: David Clegg <davec@sybase.com>
X-Mailer: Mozilla 2.01 (X11; I; Linux 1.2.13 i586)
MIME-Version: 1.0
To: Edward Bauer <bauer@stsci.edu>
Subject: Re: How Do I Force JConnect driver to be used?
References: <33522A78.1A46@stsci.edu>
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:994
Article PK: 252745

Well behaved jdbc drivers should register their URL patterns
with sun so that this doesn't happen.
Our registered name is:
jdbc:sybase:...
^^^^^^
No other JDBC drivers should process URL's with this pattern. If
you find one that does - send them a nasty note, report them to
Sun, and remove them from your setup.

Or, the SybDriver class does contain a public constructor, so you
could do:

Driver d = Class.forName("com.sybase.jdbc.SybDriver").newInstance();
Connection c = d.connect(url, properties);

The 'connect' method is a standard part of the JDBC specification, but
it is supposed to be called by the DriverManager.

It is possible that future versions of the JDBC specification would
provide additional functionality which may not work right if you are
not going through the DriverManager to make connections.

dave

>
> Suppose I have an application that loads a bunch of JDBC drivers and
> talks to multiple databases from different vendors (Sybase, Oracle,
> ...).
>
> More than one of the drivers can can talk to a Sybase database.
>
> How do I force the DriverManager to use the jConnect driver over the
> other ones??? The JDBC API says you can force it but I do not see how.
> I could deregister all drivers but the jConnect but that would defeat
> other parts of the application.
>
> Any ideas?
>
> Ted