X-Original-To: pgsql-jdbc-postgresql.org@localhost.postgresql.org Received: from localhost (av.hub.org [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 58A23D8073 for ; Tue, 22 Nov 2005 15:23:32 -0400 (AST) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 01478-05 for ; Tue, 22 Nov 2005 19:23:31 +0000 (GMT) X-Greylist: from auto-whitelisted by SQLgrey- Received: from web35001.mail.mud.yahoo.com (web35001.mail.mud.yahoo.com [209.191.68.195]) by svr1.postgresql.org (Postfix) with SMTP id 54F40D802C for ; Tue, 22 Nov 2005 15:23:29 -0400 (AST) Received: (qmail 69850 invoked by uid 60001); 22 Nov 2005 19:23:22 -0000 DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; h=Message-ID:Received:Date:From:Subject:To:In-Reply-To:MIME-Version:Content-Type:Content-Transfer-Encoding; b=2La5GfaXBhTRaCg9ZGuDOOQ2ZgWBHKj7Ub6iz7xkTBBYRl0QgaFLKXoysPJSFcgrhvBN08Xv++M8RFBHgNS66LUMbvAXuGPJfTZjpBYychXE006q5597hkAjgXTNdnRUnGwaLgX/IlGgWDkBTgB7kz86Q5DiwEPWSJohLDKUyMM= ; Message-ID: <20051122192322.69845.qmail@web35001.mail.mud.yahoo.com> Received: from [69.173.126.192] by web35001.mail.mud.yahoo.com via HTTP; Tue, 22 Nov 2005 11:23:22 PST Date: Tue, 22 Nov 2005 11:23:22 -0800 (PST) From: Benjamin Stookey Subject: Re: Deploying my application (nesting the jar) To: pgsql-jdbc@postgresql.org In-Reply-To: <1132616880.5937.4.camel@archimedes> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, score=0.359 required=5 tests=[AWL=-0.120, DNS_FROM_RFC_ABUSE=0.479] X-Spam-Score: 0.359 X-Spam-Level: X-Archive-Number: 200511/147 X-Sequence-Number: 14245 So if I extract the jar and include the class files in my project classpath, do I still instantiate the driver using: Class.forName("org.postgresql.Driver").newInstance(); I appologize for my ignorance on this one. Below is the .classpath file created by Eclipse. The extracted jar is excluded from the source, but included as a library. However, I get the "no suitable driver" SQLException. Also, when I included the Jar as a library it worked fine, just when I come to deploying this it gets complicated. Thanks, -Ben --- Mark Lewis wrote: > Well, you could actually nest the jar inside of > another jar (we've done > it here before), but you need to do some ugly things > like using your own > classloader and doing some tricks to avoid the > must-be-the-same- > classloader security checks DriverManager does. > > Just including the postgres driver classes directly > in your jar file is > simpler, and that's what we mostly do when we need > to bundle an > application with build-in PostgreSQL support. Not > sure why it's not > working for you. > > -- Mark Lewis > > On Mon, 2005-11-21 at 15:27 -0800, Benjamin Stookey > wrote: > > I realize that it's not possible to nest the jar > in > > another jar, but I was wondering if anyone could > give > > me a suggestion for deploying my application using > > this jar file. > > > > I did try extracting the jar to include the class > > files in my classpath (is this a bad idea?), but > once > > I did that I get the "No suitable driver" > > SQLException. I'm probably making some blundering > > mistake with my classpath, but I can't figure it > out. > > > > How have other people done this? Ideally, I'd like > my > > application to be in one jar file to make it > easier > > for my users. I'm still hoping this is possible... > > > > Thanks for the help, > > -Ben > > > > /** > > * @develEnv ECLIPSE > > * @javaVer JAVA 1.4.2_08 > > * @OPSystem SUSE LINUX > > */ > > > > > > > > > > __________________________________ > > Yahoo! Mail - PC Magazine Editors' Choice 2005 > > http://mail.yahoo.com > > > > ---------------------------(end of > broadcast)--------------------------- > > TIP 2: Don't 'kill -9' the postmaster > > ---------------------------(end of > broadcast)--------------------------- > TIP 5: don't forget to increase your free space map > settings > __________________________________ Yahoo! Mail - PC Magazine Editors' Choice 2005 http://mail.yahoo.com