1 Reply Latest reply on Feb 26, 2002 4:41 AM by Todd Marshall

    configure entity bean to access sqlserver

    zhebbincopng Newbie

      hello
      i am new to jboss,i have download jboss+tomcat bundle,and install it in my windows2000 server,i only know how access sqlserver within the code,but don't know how to configure the entity bean to access it,who can give me step-by-step instructions,such as how can i modify the config files and modify which files...............?

      thank you!

        • 1. Re: configure entity bean to access sqlserver
          Todd Marshall Newbie

          which version of jboss/tomcat are you running?

          Here's a quick rundown for JBoss 2.4.4 with catalina:

          you need to setup a pool in the $JBOSS_HOME/conf/catalina/jboss.jcml file

          here is an example of mine (for postgres):

          DefaultDS
          org.jboss.pool.jdbc.xa.wrapper.XADataSourceImpl

          jdbc:postgresql:dev_db
          1200000
          toddm
          10
          yourpass
          false
          false
          false
          true
          120000
          1800000
          false
          false
          1.0
          0


          put your JDBC driver info into the "URL" attribute, and your login and password info into the "JDBCUser" and "Password" attributes.

          if you want to use a datasource other than the DefaultDS
          you'll need to add a jaws.xml file to the same place you are putting the ejb-jar.xml for your EJB.

          Here is an example of one of my jaws.xml files:

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

          TestDev

          <enterprise-beans>

          <ejb-name>FUser</ejb-name>

          <cmp-field>
          <field-name>login_name</field-name>
          <column-name>login_name</column-name>
          <jdbc-type>VARCHAR</jdbc-type>
          <sql-type>VARCHAR UNIQUE</sql-type>
          </cmp-field>

          <cmp-field>
          <field-name>user_type</field-name>
          <column-name>user_type</column-name>
          <jdbc-type>INTEGER</jdbc-type>
          <sql-type>INTEGER</sql-type>
          </cmp-field>

          <cmp-field>
          <field-name>cdate</field-name>
          <column-name>cdate</column-name>
          <jdbc-type>DATE</jdbc-type>
          <sql-type>DATE</sql-type>
          </cmp-field>

          <cmp-field>
          <field-name>last_login</field-name>
          <column-name>last_login</column-name>
          <jdbc-type>DATE</jdbc-type>
          <sql-type>DATE</sql-type>
          </cmp-field>


          findByLoginName
          WHERE login_name = '{0}'





          <ejb-name>FAddress</ejb-name>


          </enterprise-beans>



          Hope this helps....

          -Todd