From: William I. Zumwalt <wizumwalt@yahoo.com>
To: pgsql-jdbc@postgresql.org
Subject: jdbc:postgresql:database not bound error
Date: Wed, 29 Sep 2004 09:17:15 -0700 (PDT)
Message-ID: <20040929161715.28323.qmail@web52410.mail.yahoo.com> (raw)
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-jdbc@postgresql.org
Cc: wizumwalt@yahoo.com
Subject: Re: jdbc:postgresql:database not bound error
In-Reply-To: <20040929161715.28323.qmail@web52410.mail.yahoo.com>
References: <20040929161715.28323.qmail@web52410.mail.yahoo.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
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