🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.jbuilder.database
Article #281

Re: MySQLException: No suitable driver.

#281
From: Paul Furbacher [TeamB]
Date: Thu, 26 Jan 2006 20:57
81 lines
4228 bytes
Zachary wrote:

> Running a macroprogram that's supposed to, among other things, 
> connect to a database.  But it's throwing the above 'SQLException'.

Above exception?  I don't see any trace above this paragraph.
Did you forget to include it?  (Hint: information in the subject
line is not information which you should/can refer to in the body
of your message.)

> I've also written a microprogram, all it does is connect to and 
> write to the database, and it works fine.  And the micro has the 
> same methodology as the macro.  It's neither a bad driver nor a bad
>  URL since they both work in the microprogram.

What do "macroprogram" and "microprogram" mean?

> I think this might be related to Luca's problem below,

Below?  If you mean "Luca's message of Dec. 30, 2005,
titled "Import schema from Database...", then no,
your problem is not related.  He was talking about
how to add the driver to the list in the EJB modeler.
You are talking about using the driver in a program;
these are very different scenarios.

> Anywho, has anyone else encountered something like this?  Even
> though the test environment (Oh, I'm using JBuilder Foundation 2005
> by the way) lists them both as having the same classpath... le
> sigh.

I did a Google on MySQLException: No suitable driver. and
found that you have been discussing this at Java Ranch.
It's pretty clear that you are flailing:

> ... I've looked at JBuilder's config file, and it says "addjars
> ../jdk1.4/lib". Other jars in jdk1.4/lib are showing up on the
> classpath, but even after I've copied mysql-connector jar into
> there, it's still not showing up on the JBuilder classpath. (of
> course, that last one can definitely be attributed to JBuilder
> oddities... then again, if the copy in macroprogram's folder is
> good enough for microprogram to work, why doesn't macroprogram
> work?) ...

You should read the JBuilder manual.  You NEVER add JAR files to
an application by altering the jbuilder.config file!  Those
directives are for JBuilder itself, not your applications run
by the IDE!  Think about it: JBuilder is a Java program, so it
needs something to set up its environment before it runs.  But,
when it runs your programs, it would be absurd to use that same
environment to do so.  It has a mechanism to create an environment
specific to your program, and that is spelled out in the
documentation.

Also, JBuilder doesn't use an external classpath when it runs your
applications.

Instead, you create a "library" in JBuilder and add that "library"
to the "Required Libraries" tab of the Project Properties > Path
page.  Read the "Configuring and Adding Libraries" in the Help
manual.

My guess is that for the small test program, you did indeed
add the driver library as required.  In the larger program,
you didn't.


-- 


Paul Furbacher (TeamB)

   Save time, search the archives:
        http://info.borland.com/newsgroups/ngsearch.html

   Is it in Joi Ellis's Faq-O-Matic?
        http://www.visi.com/~gyles19/fom-serve/cache/1.html

   Finally, please send responses to the newsgroup only.
   That means, do not send email directly to me.
   Thank you.
Technical Details
Message-ID: <43d936e3$1@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!proxad.net!212.101.4.254.MISMATCH!solnet.ch!solnet.ch!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail
References: <43d9168d$1@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Thread: 1073da,b0ce4766862eec7f
X-Google-Attributes: gid1073da,public
X-Google-Language: ENGLISH,ASCII-7-bit
Date: Thu, 26 Jan 2006 15:57:00 -0500
From: "Paul Furbacher [TeamB]" <pfurbacher@mac.com>
Organization: Reverse Alchemy, Inc.
User-Agent: Mozilla Thunderbird 1.0.6 (Macintosh/20050716)
X-Accept-Language: en-us, en
MIME-Version: 1.0
Newsgroups: borland.public.jbuilder.database
Subject: Re: MySQLException: No suitable driver.
References: <43d9168d$1@newsgroups.borland.com>
In-Reply-To: <43d9168d$1@newsgroups.borland.com>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
NNTP-Posting-Host: 69.142.194.228
Message-ID: <43d936e3$1@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1138308835 69.142.194.228 (26 Jan 2006 12:53:55 -0700)
Lines: 81
Path: arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!proxad.net!212.101.4.254.MISMATCH!solnet.ch!solnet.ch!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail