[jboss-user] [Datasource Configuration] - Re: Sybase datasource config: New missing/unsatisfied dependencies
Carey Brown
do-not-reply at jboss.com
Tue Apr 24 08:35:23 EDT 2012
Carey Brown [https://community.jboss.org/people/carey.brown] created the discussion
"Re: Sybase datasource config: New missing/unsatisfied dependencies"
To view the discussion, visit: https://community.jboss.org/message/731887#731887
--------------------------------------------------------------
Thanks for the input. Greatly appreciated. I also had missed the updating of web.xml and jboss-web.xml and didn't have the datasoure name correctly specified in the Java code.
Here's what it looked like when *I finally got it to work*.
*Java souce code*
private static final String DATA_SOURCE_NAME = "java:jboss/datasources/sybaseDS";
...
Context ctx = new InitialContext();
System.out.println( ctx );
DataSource dbSource = (DataSource)ctx.lookup( DATA_SOURCE_NAME );
ctx.close();
*webapp/web/WEB-INF/web.xml*
<resource-ref>
<res-ref-name>jdbc/sybaseDS</res-ref-name>
<res-type>javax.sql.DataSource</res-type>
<res-auth>Container</res-auth>
<res-sharing-scope>Shareable</res-sharing-scope>
</resource-ref>
*webapp/web/WEB-INF/jboss-web.xml*
<jboss-web>
<resource-ref>
<res-ref-name>jdbc/sybaseDS</res-ref-name>
<jndi-name>java:jboss/datasources/sybaseDS</jndi-name>
</resource-ref>
</jboss-web>
*jboss-as-7.1.1.Final\modules\com\sybaseDS\sybase\main\module.xml*
<module xmlns="urn:jboss:module:1.1" name="com.sybaseDS.sybase">
<resources>
<resource-root path="jconn4.jar"/>
<!-- Insert resources here -->
</resources>
<dependencies>
<module name="javax.api"/>
</dependencies>
</module>
*jboss-as-7.1.1.Final\standalone\configuration\standalone.xml*
<datasources>
<datasource jndi-name="java:jboss/datasources/sybaseDS"
pool-name="sybaseDS" enabled="true">
<connection-url>jdbc:sybase:Tds:10.250.5.27:5000</connection-url>
<driver-class>com.sybase.jdbc4.jdbc.SybDriver</driver-class>
<driver>sybaseDriver</driver>
<security>
<user-name>sa</user-name>
<password>angels</password>
</security>
</datasource>
<drivers>
<driver name="sybaseDriver" module="com.sybaseDS.sybase"/>
</drivers>
</datasources>
--------------------------------------------------------------
Reply to this message by going to Community
[https://community.jboss.org/message/731887#731887]
Start a new discussion in Datasource Configuration at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2077]
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/jboss-user/attachments/20120424/eebceeb4/attachment.html
More information about the jboss-user
mailing list