4 Replies Latest reply on May 30, 2008 11:16 AM by pjohlie

    Cannot get JtdsDataSource from Jboss config setup

    pjohlie

      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: