-
1. Re: jndi datasource not found?
jonlee Jun 19, 2003 9:03 AM (in response to maomao1234)OK. Assume you have a datasource, sybase-ds.xml defined in the server/default/deploy directory of JBoss.
<?xml version="1.0" encoding="UTF-8"?>
<!-- ===================================================================== -->
<!-- -->
<!-- JBoss Server Configuration -->
<!-- -->
<!-- New ConnectionManager setup for Sybase ASE/ASA jConnect driver -->
<!-- Thanks to Marc Zampetti <zampetti@aol.net> -->
<!-- This is a minimal example. See the generic example for other stuff -->
<!-- ===================================================================== -->
<!-- $Id: sybase-ds.xml,v 1.1 2002/07/31 21:58:44 d_jencks Exp $ -->
<local-tx-datasource>
<jndi-name>jdbc/SybaseDB</jndi-name>
<!-- Sybase jConnect URL for the database.
NOTE: The hostname and port are made up values. The optional
database name is provided, as well as some additinal Driver
parameters.
-->
<connection-url>jdbc:sybase:Tds:host.at.some.domain:5000/db_name?JCONNECT_VERSION=6</connection-url>
<driver-class>com.sybase.jdbc2.jdbc.SybDataSource</driver-class>
<user-name>x</user-name>
y
</local-tx-datasource>
The datasource connection is:
Datasource ds = (DataSource)ctx.lookup("java:/jdbc/SybaseDB");
You can also see your JNDI bindings in the JBoss jmx-console webapp, from the jndi-view link.