1 Reply Latest reply on May 3, 2002 12:30 PM by jasen

    *service.xml for MS's JDBC Driver

    seanhowell

      Help

      I downloaded the MS JDBC driver, hacked the example at http://www.jboss.org/online-manual/HTML/ch03.html Still it does nothing.

      Is anyone using the MS JDBC driver in it's current form, and can spare me a peek at their *service.xml for it?

      Cheers

      Sean

        • 1. Re: *service.xml for MS's JDBC Driver
          jasen

          We have been trying deploy to JBoss 3.0 RC2 and persist to a MS Access 2000, with some success. It is a bit messy at the moment, but hope this helps.

          We have access-service file, calling the realm "AccessDBRealm", the data source "AccessDS", using the "sun.jdbc.odbc.JdbcOdbcDriver" and accessing a database called "Address".


          access-service file:



          <!--comment out this line if you want component managed security or want
          to use the default values in the ManagedConnectionFactoryProperties
          AccessDBRealm
          -->
          <depends optional-attribute-name="ManagedConnectionFactoryName">
          <!--embedded mbean-->


          AccessDS



          <config-property name="ConnectionURL" type="java.lang.String">jdbc:odbc:Address</config-property>
          <config-property name="DriverClass" type="java.lang.String">sun.jdbc.odbc.JdbcOdbcDriver</config-property>
          <!--set these only if you want only default logins, not through JAAS

          <config-property name="" type="java.lang.String"></config-property>
          <config-property name="" type="java.lang.String"></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




          We added the following to the login-config.xml:

          <application-policy name = "AccessDbRealm">

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

          </application-policy>


          We also added the following to the standardjbosscmp-jdbc.xml:

          <jbosscmp-jdbc>


          java:/AccessDS
          <datasource-mapping>MS Access2000</datasource-mapping>

          <create-table>true</create-table>
          <remove-table>false</remove-table>
          <read-only>false</read-only>
          <time-out>300</time-out>
          <pk-constraint>true</pk-constraint>
          <fk-constraint>false</fk-constraint>
          <row-locking>false</row-locking>
          <preferred-relation-mapping>foreign-key</preferred-relation-mapping>
          <read-ahead>
          on-load
          <page-size>1000</page-size>
          <eager-load-group>*</eager-load-group>
          </read-ahead>
          <list-cache-max>1000</list-cache-max>


          <type-mappings>
          <type-mapping>
          MS Access2000
          <row-locking-template>SELECT ?1 FROM ?2 WHERE ?3 FOR UPDATE</row-locking-template>
          <pk-constraint-template>CONSTRAINT ?1 PRIMARY KEY (?2)</pk-constraint-template>
          <fk-constraint-template>ALTER TABLE ?1 ADD CONSTRAINT ?2 FOREIGN KEY (?3) REFERENCES ?4 (?5)</fk-constraint-template>
          <alias-header-prefix>t</alias-header-prefix>
          <alias-header-suffix>_</alias-header-suffix>
          <alias-max-length>32</alias-max-length>
          <subquery-supported>true</subquery-supported>


          <java-type>java.lang.String</java-type>
          <jdbc-type>VARCHAR</jdbc-type>
          <sql-type>VARCHAR(255)</sql-type>


          <java-type>java.lang.Integer</java-type>
          <jdbc-type>INTEGER</jdbc-type>
          <sql-type>INTEGER</sql-type>


          <java-type>java.math.BigInteger</java-type>
          <jdbc-type>BIGINT</jdbc-type>
          <sql-type>Integer</sql-type>


          <java-type>java.lang.Float</java-type>
          <jdbc-type>FLOAT</jdbc-type>
          <sql-type>FLOAT</sql-type>


          <java-type>java.lang.Double</java-type>
          <jdbc-type>DOUBLE</jdbc-type>
          <sql-type>DOUBLE</sql-type>


          <java-type>java.math.BigDecimal</java-type>
          <jdbc-type>NUMERIC</jdbc-type>
          <sql-type>NUMERIC</sql-type>


          <java-type>java.lang.Short</java-type>
          <jdbc-type>SMALLINT</jdbc-type>
          <sql-type>SMALLINT</sql-type>


          <java-type>java.lang.Long</java-type>
          <jdbc-type>BIGINT</jdbc-type>
          <sql-type>LONG</sql-type>


          <java-type>java.lang.Byte</java-type>
          <jdbc-type>TINYINT</jdbc-type>
          <sql-type>TINYINT</sql-type>


          <java-type>java.lang.Character</java-type>
          <jdbc-type>CHAR</jdbc-type>
          <sql-type>CHAR(1)</sql-type>


          <java-type>java.lang.Object</java-type>
          <jdbc-type>JAVA_OBJECT</jdbc-type>
          <sql-type>OLEOBJECT</sql-type>



          <java-type>java.sql.Timestamp</java-type>
          <jdbc-type>TIMESTAMP</jdbc-type>
          <sql-type>DateTime</sql-type>



          <java-type>java.sql.Date</java-type>
          <jdbc-type>DATE</jdbc-type>
          <sql-type>DATE</sql-type>



          <java-type>java.sql.Time</java-type>
          <jdbc-type>TIME</jdbc-type>
          <sql-type>TIME</sql-type>



          <java-type>java.util.Date</java-type>
          <jdbc-type>DATE</jdbc-type>
          <sql-type>DATA</sql-type>



          <java-type>java.lang.Boolean</java-type>
          <jdbc-type>BIT</jdbc-type>
          <sql-type>YESNO</sql-type>

          </type-mapping>
          ....


          Hope this helps.