Return-Path: Delivered-To: apmail-db-derby-user-archive@www.apache.org Received: (qmail 19115 invoked from network); 31 Mar 2010 18:58:39 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 31 Mar 2010 18:58:39 -0000 Received: (qmail 22877 invoked by uid 500); 31 Mar 2010 18:58:39 -0000 Delivered-To: apmail-db-derby-user-archive@db.apache.org Received: (qmail 22737 invoked by uid 500); 31 Mar 2010 18:58:38 -0000 Mailing-List: contact derby-user-help@db.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: List-Post: List-Id: Reply-To: "Derby Discussion" Delivered-To: mailing list derby-user@db.apache.org Received: (qmail 22730 invoked by uid 99); 31 Mar 2010 18:58:38 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 31 Mar 2010 18:58:38 +0000 X-ASF-Spam-Status: No, hits=1.2 required=10.0 tests=FORGED_HOTMAIL_RCVD2,FREEMAIL_FROM,SPF_HELO_PASS,SPF_PASS,T_TO_NO_BRKTS_FREEMAIL X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of lists@nabble.com designates 216.139.236.158 as permitted sender) Received: from [216.139.236.158] (HELO kuber.nabble.com) (216.139.236.158) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 31 Mar 2010 18:58:33 +0000 Received: from isper.nabble.com ([192.168.236.156]) by kuber.nabble.com with esmtp (Exim 4.63) (envelope-from ) id 1Nx37E-0004xu-UB for derby-user@db.apache.org; Wed, 31 Mar 2010 11:58:13 -0700 Message-ID: <28100339.post@talk.nabble.com> Date: Wed, 31 Mar 2010 11:58:12 -0700 (PDT) From: babylonlion To: derby-user@db.apache.org Subject: Re: No suitable driver found for jdbc:derby In-Reply-To: <28100309.post@talk.nabble.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Nabble-From: sanlee225@hotmail.com References: <28099914.post@talk.nabble.com> <3A652655-FA6A-4EAD-BAA6-4CE4E0B00442@gmail.com> <28100127.post@talk.nabble.com> <28100309.post@talk.nabble.com> I'm sorry but I'm really new to this and I'm not sure how or where to add this piece of code. And what is "class.forName"? By the way, my instructore has the same exact code and it's working fine. I did everything the way he has on his computer but no luck. It's weird ronchalant wrote: > > Before attempting to make the connection in your ExecSQL.getConnection() > method by the looks of it. > > You can also add it anywhere in that class statically like this: > > static { > Class.forName("org.apache.derby.jdbc.EmbeddedDriver").newInstance(); > } > > > On Mar 31, 2010, at 2:43:23 PM, babylonlion wrote: > >> >> Where do I need to add it? >> >> ronchalant wrote: >>> >>> Try adding this first: >>> >>> Class.forName("org.apache.derby.jdbc.EmbeddedDriver").newInstance(); >>> >>> Adjust the classname for whichever driver you're using. >>> >>> -Ron >>> >>> On Mar 31, 2010, at 2:26:11 PM, babylonlion wrote: >>> >>>> >>>> Hi experts, >>>> >>>> I'm using JCreater to run a java program but after the program compiles >>>> successfully, I get this error message: >>>> >>>> java.sql.SQLException: No suitable driver found for >>>> jdbc:derby:COREJAVA;create=true >>>> at java.sql.DriverManager.getConnection(DriverManager.java:602) >>>> at java.sql.DriverManager.getConnection(DriverManager.java:185) >>>> at ExecSQL.getConnection(ExecSQL.java:86) >>>> at ExecSQL.main(ExecSQL.java:22) >>>> >>>> I'm using an emdedded driver. And I'm creating a database called >>>> COREJAVA >>>> >>>> My environment variables are as follows: >>>> CLASSPATH: .;C:\Apache\db-derby-10.5.3.0-bin\lib\derby.jar >>>> HOME_DERBY: C:\Apache\db-derby-10.5.3.0-bin >>>> Path: %DERBY_HOME%\bin >>>> >>>> I've been working on it since Monday but couldn't get anywhere. Please >>>> help >>>> me >>>> -- >>>> View this message in context: >>>> http://old.nabble.com/No-suitable-driver-found-for-jdbc%3Aderby-tp28099914p28099914.html >>>> Sent from the Apache Derby Users mailing list archive at Nabble.com. >>>> >>> >>> >>> >> >> -- >> View this message in context: >> http://old.nabble.com/No-suitable-driver-found-for-jdbc%3Aderby-tp28099914p28100127.html >> Sent from the Apache Derby Users mailing list archive at Nabble.com. >> > > > -- View this message in context: http://old.nabble.com/No-suitable-driver-found-for-jdbc%3Aderby-tp28099914p28100339.html Sent from the Apache Derby Users mailing list archive at Nabble.com.