Received: from localhost (unknown [200.46.204.191]) by postgresql.org (Postfix) with ESMTP id 3ED3D9FB8E4 for ; Fri, 31 Aug 2007 21:06:03 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.191]) (amavisd-maia, port 10024) with ESMTP id 93500-03 for ; Fri, 31 Aug 2007 21:05:56 -0300 (ADT) X-Greylist: delayed 06:37:43.425948 by SQLgrey-1.7.5 Received: from sineb-mail-2.sun.com (sineb-mail-2.sun.com [192.18.19.7]) by postgresql.org (Postfix) with ESMTP id C22459FB8F7 for ; Fri, 31 Aug 2007 21:05:55 -0300 (ADT) Received: from fe-apac-02.sun.com (fe-apac-02.sun.com [192.18.19.173] (may be forged)) by sineb-mail-2.sun.com (8.13.6+Sun/8.12.9) with ESMTP id l7UAYM5X017460 for ; Thu, 30 Aug 2007 10:34:27 GMT Received: from conversion-daemon.mail-apac.sun.com by mail-apac.sun.com (Sun Java System Messaging Server 6.2-6.01 (built Apr 3 2006)) id <0JNL00H010M38A00@mail-apac.sun.com> (original mail from Mayuresh.Nirhali@Sun.COM) for pgsql-jdbc@postgresql.org; Thu, 30 Aug 2007 18:34:22 +0800 (SGT) Received: from [129.158.227.167] by mail-apac.sun.com (Sun Java System Messaging Server 6.2-6.01 (built Apr 3 2006)) with ESMTPSA id <0JNL0025R1D9EA20@mail-apac.sun.com>; Thu, 30 Aug 2007 18:34:22 +0800 (SGT) Date: Thu, 30 Aug 2007 16:00:25 +0530 From: Mayuresh Nirhali Subject: Re: Problem connecting to a pgsql database from Net Beans. In-reply-to: To: Flavio Monteiro Cc: pgsql-jdbc Message-id: <46D69C41.4020807@Sun.COM> MIME-version: 1.0 Content-type: text/plain; format=flowed; charset=ISO-8859-1 Content-transfer-encoding: 7BIT References: User-Agent: Thunderbird 2.0.0.0 (X11/20070423) X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0.224 tagged_above=0 required=5 tests=AWL=0.964, BAYES_20=-0.74 X-Spam-Level: X-Archive-Number: 200708/109 X-Sequence-Number: 17422 Flavio, I am not NB expert, but I find it useful to setup my DB connections the following way, Before, Configuring Connection Pool to your application, I prefer setting up the Database connection itself with the specific DB driver/datasource. I am using NB 5.5 as of now. 1. go to 'Runtime' tab, Click on 'Database'. Expand 'Drivers'. If you do not have your PG driver setup, set a new Driver by doing right click on 'Drivers' -> 'New Driver'. Here, you could specify the location of the pgjdbc jar file and you need not worry about keeping that in specific directory. 2. Now, to setup DB connection, right click on 'Database', 'New Connection'. Follow the next screen and your connection should be ready, if things go well, NB will also test your connection as it will report if the connection has been established or not. I found this to be pretty useful. HTH Mayuresh Flavio Monteiro wrote: > Hi, > > now I've copied "postgresql-8.2-506.jdbc3.jar" into > "/opt/SUNWappserver/lib" and Im getting a less scaring log: > > RAR5038:Unexpected exception while creating resource > RAR5117 : Failed to obtain/create connection. Reason : Connection > could not be allocated because: FATAL: database "null" does not exist > RAR5114 : Error allocating connection : [Error in allocating a > connection. Cause: Connection could not be allocated because: FATAL: > database "null" does not exist] > java.sql.SQLException: Error in allocating a connection. Cause: > Connection could not be allocated because: FATAL: database "null" does > not exist > StandardWrapperValve[ClientInfo]: Servlet.service() for servlet > ClientInfo threw exception > java.lang.NullPointerException > at org.ClientInfo.doGet(ClientInfo.java:38) > at javax.servlet.http.HttpServlet.service (HttpServlet.java:707) > at javax.servlet.http.HttpServlet.service(HttpServlet.java:820) > at > org.apache.catalina.core.ApplicationFilterChain.servletService(ApplicationFilterChain.java:397) > at > org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:278) > at > org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:566) > at org.apache.catalina.core.StandardPipeline.invoke > (StandardPipeline.java:536) > at > org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContextValve.java:240) > at > org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java > :179) > at > org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:566) > at com.sun.enterprise.web.WebPipeline.invoke(WebPipeline.java:73) > at org.apache.catalina.core.StandardHostValve.invoke > (StandardHostValve.java:182) > at > org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:566) > at > com.sun.enterprise.web.VirtualServerPipeline.invoke(VirtualServerPipeline.java:120) > at > org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:939) > at > org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:137) > at org.apache.catalina.core.StandardPipeline.doInvoke > (StandardPipeline.java:566) > at > org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:536) > at > org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:939) > at org.apache.coyote.tomcat5.CoyoteAdapter.service > (CoyoteAdapter.java:239) > at > com.sun.enterprise.web.connector.grizzly.ProcessorTask.invokeAdapter(ProcessorTask.java:667) > at > com.sun.enterprise.web.connector.grizzly.ProcessorTask.processNonBlocked(ProcessorTask.java > :574) > at > com.sun.enterprise.web.connector.grizzly.ProcessorTask.process(ProcessorTask.java:844) > at > com.sun.enterprise.web.connector.grizzly.ReadTask.executeProcessorTask(ReadTask.java:287) > at > com.sun.enterprise.web.connector.grizzly.ReadTask.doTask(ReadTask.java:212) > at > com.sun.enterprise.web.connector.grizzly.TaskBase.run(TaskBase.java:252) > at com.sun.enterprise.web.connector.grizzly.WorkerThread.run > (WorkerThread.java:75) > > > > -- > Flavio Monteiro