pg.ddx.io  pgsql-jdbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
jdbc:postgresql:database not bound error
2+ messages / 2 participants
[nested] [flat]

* jdbc:postgresql:database not bound error
@ 2004-09-29 16:17  William I. Zumwalt <wizumwalt@yahoo.com>
  0 siblings, 1 reply; 2+ messages in thread

From: William I. Zumwalt @ 2004-09-29 16:17 UTC (permalink / raw)
  To: pgsql-jdbc

Hey all,

I'm using ...

JBoss 3.2.5
pg74.215.jdbc3.jar
postgres7.4.5

When I load my app in jboss, jboss sees postgres as

09:32:37,214 INFO  [PostgresDS] Bound connection
factory for resource adapter for ConnectionManager
'jboss.jca:service=LocalTxCM,name=PostgresDS to JNDI
name 'java:/PostgresDS'

And I'm getting the following error ...

10:36:26,231 INFO  [STDOUT] Exception:
jdbc:postgresql:megs not bound

Anyone have ideas what the prob could be. I've got the
following code below.

---
    public static final String DRIVER =
"org.postgresql.Driver";
    public static final String DBURL =
"jdbc:postgresql:megs";
                                                      
                         // megs is my dbase name
    private static transient DataSource dataSource =
null;
                                                      
                         
    static {
        try {
            Class.forName(DRIVER);
        }
        catch(ClassNotFoundException cnfe) {
           
System.out.println("ClassNotFoundException: " +
cnfe.getMessage());
        }
    }

    public static Connection createConnection() throws
SQLException {
        if (dataSource == null) {
            try {
                Context context = new
InitialContext();
                dataSource = (DataSource)
context.lookup(DBURL);
            }
            catch (Exception e) {
                System.out.println("Exception: " +
e.getMessage());
            }
        }
                                                      
                         
        return dataSource.getConnection();
    }

Any help much appreciated.

__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 



^ permalink  raw  reply  [nested|flat] 2+ messages in thread

* Re: jdbc:postgresql:database not bound error
@ 2004-09-29 22:28  Oliver Jowett <oliver@opencloud.com>
  parent: William I. Zumwalt <wizumwalt@yahoo.com>
  0 siblings, 0 replies; 2+ messages in thread

From: Oliver Jowett @ 2004-09-29 22:28 UTC (permalink / raw)
  To: William I. Zumwalt <wizumwalt@yahoo.com>; +Cc: pgsql-jdbc

William I. Zumwalt wrote:

> 09:32:37,214 INFO  [PostgresDS] Bound connection
> factory for resource adapter for ConnectionManager
> 'jboss.jca:service=LocalTxCM,name=PostgresDS to JNDI
> name 'java:/PostgresDS'

> 10:36:26,231 INFO  [STDOUT] Exception:
> jdbc:postgresql:megs not bound

>     public static final String DBURL =
> "jdbc:postgresql:megs";

>                 Context context = new
> InitialContext();
>                 dataSource = (DataSource)
> context.lookup(DBURL);

Shouldn't you be doing a lookup of "java:/PostgresDS", not DBURL?

Either way, it sounds like a jboss/application config error, not a JDBC 
driver error. You might want to try a jboss list if changing the lookup 
doesn't help.

-O



^ permalink  raw  reply  [nested|flat] 2+ messages in thread


end of thread, other threads:[~2004-09-29 22:28 UTC | newest]

Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2004-09-29 16:17 jdbc:postgresql:database not bound error William I. Zumwalt <wizumwalt@yahoo.com>
2004-09-29 22:28 ` Oliver Jowett <oliver@opencloud.com>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox