4 Replies Latest reply on Jul 15, 2002 2:57 PM by Todd

    jdbcOdbcBridge service for CMP (JBoss3)

    David Treves Newbie

      Hi all,

      I searched ALL the forums, and could not find this question... I am using JBoss 3 (beta) and I wish to create a service that will connect me to an MS SQL server 7 database.

      I managed to get to some examples of "*-service.xml" files, but none were for jdbcOdbcBrigde. I am aware of the performance of the bridge, but that's another issue...

      Can anyone please post a valid version of an XML service file for connecting via ODBC to a DB server using that bridge?

      Thanks!
      David.

        • 1. Re: jdbcOdbcBridge service for CMP (JBoss3)
          Dain Sundstrom Master

          Don't use that lame odbc bridge driver. There are other drivers available, and there is even one available from ms at:

          http://www.microsoft.com/sql/downloads/default.asp

          • 2. Re: jdbcOdbcBridge service for CMP (JBoss3)
            David Treves Newbie

            Hi Dain,

            I am working with SQL 7, and currently there is no available FREE JDBC driver for it.

            If there is a driver please notify me...

            Thanks!
            David.

            • 3. Re: jdbcOdbcBridge service for CMP (JBoss3)
              Todd Newbie

              I'm struggling with this same issue. I used to connect with the jdbc/odbc bridge from JBoss 2.4 to SQL Server 7.0 with no issues. But with the upgrade to JBoss 3.0, I'm connectionless.

              I'm on NT4-SP5, Java SDK 1.4, JBoss 3.0, and my config files look like this:

              === login-config.xml ===
              <application-policy name = "MSSQLDbRealm">

              <login-module code = "org.jboss.resource.security.ConfiguredIdentityLoginModule"
              flag = "required">
              <module-option name = "principal">sa</module-option>
              <module-option name = "userName">sa</module-option>
              <module-option name = "password">scoobydoo</module-option>
              <module-option name = "managedConnectionFactoryName">jboss.jca:service=LocalTxCM,name=MSSQLDS</module-option>
              </login-module>

              </application-policy>
              === login-config.xml ===

              === mssql-service.xml ===




              MSSQLDbRealm

              <depends optional-attribute-name="ManagedConnectionFactoryName">
              <!--embedded mbean-->


              MSSQLDS



              <config-property name="ConnectionURL" type="java.lang.String">jdbc:odbc:AdvisorClientDev</config-property>
              <config-property name="DriverClass" type="java.lang.String">org.jboss.pool.jdbc.xa.wrapper.XADataSourceImpl</config-property>



              <!--Below here are advanced properties -->
              <!--hack-->
              <depends optional-attribute-name="OldRarDeployment">jboss.jca:service=RARDeployment,name=JBoss LocalTransaction JDBC Wrapper



              <depends optional-attribute-name="ManagedConnectionPool">
              <!--embedded mbean-->


              0
              50
              5000
              15
              <!--criteria indicates if Subject (from security domain) or app supplied
              parameters (such as from getConnection(user, pw)) are used to distinguish
              connections in the pool. Choices are
              ByContainerAndApplication (use both),
              ByContainer (use Subject),
              ByApplication (use app supplied params only),
              ByNothing (all connections are equivalent, usually if adapter supports
              reauthentication)-->
              ByContainer



              <depends optional-attribute-name="CachedConnectionManager">jboss.jca:service=CachedConnectionManager

              <depends optional-attribute-name="JaasSecurityManagerService">jboss.security:name=JaasSecurityManager

              java:/TransactionManager
              <!--make the rar deploy! hack till better deployment-->
              jboss.jca:service=RARDeployer




              === mssql-service.xml ===


              The error I get is here:
              [java] org.jboss.util.NestedSQLException: Failed to register driver for: or
              g.jboss.pool.jdbc.xa.wrapper.XADataSourceImpl; - nested throwable: (java.lang.Cl
              assNotFoundException: org.jboss.pool.jdbc.xa.wrapper.XADataSourceImpl); - nested
              throwable: (org.jboss.resource.ResourceException: Failed to register driver for
              : org.jboss.pool.jdbc.xa.wrapper.XADataSourceImpl; - nested throwable: (java.lan
              g.ClassNotFoundException: org.jboss.pool.jdbc.xa.wrapper.XADataSourceImpl))

              So I'm thinking that the XADataSourceImpl is in a different place or doesn't exist at all anymore in 3.0. I can't download the JBoss source here at work because of a network security policy that I won't get into. I'll do that at home when I get a chance... Using Google here at work, I didn't find much.

              The other thing I wonder is if I should be using XADataSourceImpl anyway since in the config files I specified LocalTxCM rather than xa, but maybe I'm out to lunch on that.

              Well, any help is appreciated. I just found the free driver at thinweb.com so I'll try that too.

              • 4. Re: jdbcOdbcBridge service for CMP (JBoss3)
                Todd Newbie

                replying to myself...

                The thinweb.com driver worked for me on the first try. I haven't done lots of testing or anything, but I read the contents of a table so that's a good start.

                Here's how you do it:
                1) copy the TwFreeTds_1.0.jar to your lib directory
                2) use the configuration of my previous post except for the following two lines in mssql-service:

                <config-property name="ConnectionURL" type="java.lang.String">jdbc:twtds:sqlserver://machinename/databasename</config-property>
                <config-property name="DriverClass" type="java.lang.String">com.thinweb.tds.Driver</config-property>

                3) enjoy the connected goodness

                good luck everyone,
                Todd