This content has been marked as final.
Show 3 replies
-
1. Re: jdbc not bound
mario202 Dec 29, 2004 9:22 AM (in response to barunkdas)Hi
Have you deployed your Postgres - data source definition?
Here a sample...
Data Source definition File:
/jboss-4.0.0/server/default/deploy/postgres-ds.xml
Note that the name of the data source definition file must end with -ds.xml<?xml version="1.0" encoding="UTF-8"?> <!-- ===================================================================== --> <!-- --> <!-- JBoss Server Configuration --> <!-- --> <!-- ===================================================================== --> <!-- $Id: postgres-ds.xml,v 1.3 2004/09/15 14:37:40 loubyansky Exp $ --> <!-- ==================================================================== --> <!-- Datasource config for Postgres --> <!-- ==================================================================== --> <datasources> <local-tx-datasource> <jndi-name>PostgresDS</jndi-name> <connection-url>jdbc:postgresql://localhost:5432/jdb?autoReconnect=true</connection-url> <driver-class>org.postgresql.Driver</driver-class> <user-name>juser</user-name> <password>jpw</password> <!-- sql to call when connection is created <new-connection-sql>some arbitrary sql</new-connection-sql> --> <!-- sql to call on an existing pooled connection when it is obtained from pool <check-valid-connection-sql>some arbitrary sql</check-valid-connection-sql> --> <!-- corresponding type-mapping in the standardjbosscmp-jdbc.xml (optional) --> <metadata> <type-mapping>PostgreSQL 7.2</type-mapping> </metadata> </local-tx-datasource> </datasources>
-
2. Re: jdbc not bound
viktor_i Jan 4, 2005 9:34 AM (in response to barunkdas)Did you try
DataSource ds = (DataSource) ctx.lookup("java:jdbc/myCoreDS"); -
3. Re: jdbc not bound
lafr Jan 4, 2005 6:03 PM (in response to barunkdas)The jndi-name of your datasource is combined of "java:" and the jndi-name from the -ds.xml file.
Take a look at jmx-console/JNDIView to see what's available.