[jboss-user] [JCA/JBoss] - Cannot get JtdsDataSource from Jboss config setup

pjohlie do-not-reply at jboss.com
Thu May 29 12:13:14 EDT 2008


Hello
I cannot get a net.sourceforge.jtds.jdbcx.JtdsDataSource from a  element in a -ds.xml file. All I get is a CCE because the object returned form the JNDI lookup is a org.jboss.resource.adapter.jdbc.WrapperDataSource and not a JtdsDataSource, as I had hoped.

Here are the informative files:
[u]jsp file:
  InitialContext ic = new InitialContext(); 
  Object obj=ic.lookup( dsJNDI ); 
  System.out.println("obj="+obj);
  jtds = (JtdsDataSource)ic.lookup( dsJNDI ); <--- CCE HERE
  con = jtds.getConnection(); 
  pr = con.prepareStatement("select count(*) from vpt_tblHits"); 

-ds.xml:
<local-tx-datasource>
    <jndi-name>MercuryDS</jndi-name>
      <connection-url>jdbc:jtds:sqlserver://server:1433;databaseName=Mercury</connection-url>
    <driver-class>net.sourceforge.jtds.jdbcx.JtdsDataSource</driver-class> 
    <user-name>user</user-name>
    pw
    <min-pool-size>1</min-pool-size>
    <max-pool-size>10</max-pool-size>
      
         <type-mapping>MS SQLSERVER2000</type-mapping>
      
  </local-tx-datasource>

web.xml:

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4154377#4154377

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4154377



More information about the jboss-user mailing list