6 Replies Latest reply on Jun 25, 2002 12:32 PM by lasterra

    Microsoft's JDBC Drivers with SQL Server

    jmejia424

      Has anyone SUCCESSFULLY been able to get Microsoft's JDBC Drivers to work with SQL Server and JBoss 3.0?

      They do NOT work. Whenever trying to get an attribute from the home, it throws

      [Microsoft][SQLServer JDBC Driver]ResultSet can not re-read row data for column
      6.;

      Column 6 is a VARCHAR. It should work.

      PLEASE help me!

        • 1. Re: Microsoft's JDBC Drivers with SQL Server
          panosk

          I used Microsoft's JDBC Driver succesfully. The only problem i had was that when you call a prepared statement that updates a table that has a trigger on it, it sends back two results.
          One for the trigger and one for the actual update. that causes serious problems to CMP Beans that map to that table. The only workaround i found is to remove the triggers.

          • 2. Re: Microsoft's JDBC Drivers with SQL Server
            lasterra

            try this URL. Take care of SelectMethod=cursor.

            jdbc:microsoft:sqlserver://server:1433;SelectMethod=cursor;DatabaseName=BD;

            HTH.

            • 3. Re: Microsoft's JDBC Drivers with SQL Server
              jmejia424

              Do you happen to have your configuration files for setting up the SQL Server and Microsoft JDBC Drivers?

              I have used the selectCursor, still to no avail.

              I am using BMP instead of CMP, because of legacy systems. I setup the DataSource from the QuickStart guide on sourceforge. That doesn't seem to work.

              Any direction would be greatly appreciated.

              Thanks.

              • 4. Re: Microsoft's JDBC Drivers with SQL Server
                jmejia424

                Sorry, I meant SelectMethod=Cursor.

                • 5. Re: Microsoft's JDBC Drivers with SQL Server
                  panosk

                  Also try this xml which was posted at the mailing list.
                  I haven't tested it but it seems to deploy ok.

                  <?xml version="1.0" encoding="UTF-8"?>

                  <!--
                  =====================================================================
                  -->
                  <!--
                  -->
                  <!-- JBoss Server Configuration
                  -->
                  <!--
                  -->
                  <!--
                  =====================================================================
                  -->




                  <!--
                  ==================================================================== -->
                  <!-- ConnectionManager setup for xa Microsoft SQL Server 2000, using
                  -->
                  <!-- Microsoft's JDBC driver.
                  -->
                  <!--
                  ==================================================================== -->


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

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

                  <!--hack-->
                  <depends
                  optional-attribute-name="OldRarDeployment">jboss.jca:service=RARDeployme
                  nt,name=Minerva JDBC XATransaction ResourceAdapter

                  <!--real attributes-->


                  <config-property>

                  <config-property-name>XADataSourceClass</config-property-name>

                  <config-property-type>java.lang.String</config-property-type>

                  <config-property-value>com.microsoft.jdbcx.sqlserver.SQLServerDataSource
                  </config-property-value>
                  </config-property>
                  <config-property>

                  <config-property-name>XADataSourceProperties</config-property-name>

                  <config-property-type>java.lang.String</config-property-type>

                  <config-property-value>ServerName=yourserver;DatabaseName=yourdatabasena
                  me;SelectMethod=cursor</config-property-value>
                  </config-property>


                  MSSQLXaDS


                  <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=Cach
                  edConnectionManager

                  <!-- Include a login module configuration named MSSQLXaDbRealm.
                  Update your login-conf.xml, here is an example for a
                  ConfiguredIdentityLoginModule:

                  <application-policy name = "MSSQLXaDbRealm">

                  <login-module code =
                  "org.jboss.resource.security.ConfiguredIdentityLoginModule" flag =
                  "required">
                  <module-option name =
                  "principal">yourprincipal</module-option>
                  <module-option name =
                  "userName">yourusername</module-option>
                  <module-option name =
                  "password">yourpassword</module-option>
                  <module-option name =
                  "managedConnectionFactoryName">jboss.jca:service=XATxCM,name=MSSQLXaDS</
                  module-option>
                  </login-module>

                  </application-policy>

                  NOTE: the application-policy name attribute must match
                  SecurityDomainJndiName, and the
                  module-option name = "managedConnectionFactoryName"
                  must match the object name of the ConnectionManager you are
                  configuring here.
                  -->
                  <!--uncomment out this line if you are using the MSSQLXaDbRealm
                  above
                  MSSQLXaDbRealm
                  -->

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

                  java:/TransactionManager




                  • 6. Re: Microsoft's JDBC Drivers with SQL Server
                    lasterra

                    i only follow the help of the MS SQL SERVER JDBC driver docs.

                    Do you copy the *.jar files of the driver in JBoss/lib/ext???

                    i'm using Jboss 2.4.x, but i supose that in JBoss 3.0 is similar.

                    HTH