4 Replies Latest reply on Mar 19, 2004 12:00 AM by muzairkhan

    SQL Server and JBOSS configuration

    muzairkhan Newbie

      hello ,

      i am new one with JBOSS and i have run into a problem regarding data sources.

      I want to set up by EJB's to read data from a table in SQL server.

      I have copied the SQL Server service file from the docs folder to the deploy folder and made the changes like , setting the service name to MSSQLDS . also , i am using , sa account to connect to the server .
      Now when i look up a table , temo in a database test on the server , i get the following error on executing a query

      table temp not found in statement .......insert into temp values ('a','b');

      What can be the problem.... On the server machine i have installed the Microsoft jdbc driver . do i need to make other changes to any other file ..

      plz reply as sooon as possible

        • 1. Re: SQL Server and JBOSS configuration
          muzairkhan Newbie

          here are the importtant parts of my



          ..

          <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">sapass</module-option>

          ...
          <config-property name="ConnectionURL" type="java.lang.String">jdbc:microsoft:sqlserver://MULTIMEDIA4:1433;DatabaseName='Test'</config-property>
          <config-property name="DriverClass" type="java.lang.String">com.microsoft.jdbc.sqlserver.SQLServerDriver</config-property>
          <!--set these only if you want only default logins, not through JAAS-->
          <config-property name="UserName" type="java.lang.String">sa</config-property>
          <config-property name="Password" type="java.lang.String">sapass</config-property>

          </

          • 2. Re: SQL Server and JBOSS configuration
            Adrian Brock Master

            Post the full stacktrace and your datasource configuration.

            Regards,
            Adrian

            • 3. Re: SQL Server and JBOSS configuration
              muzairkhan Newbie

              hi , thanks for looking into this . i think i know wat the problem is .
              I ran a create query and , i found out that instead of creating the table on SQL Server , the table got created on the Hypersonic SQL .

              I have removed the hsql-service file fromt the deploy folder and now i am gettting a mssqldbds no bound error.
              Howver when i run the server , it says



              09:54:22,011 INFO [MainDeployer] Starting deployment of package: file:/C:/jboss
              -3.0.4/jboss-3.0.4/server/default/deploy/mssqldb-service.xml
              09:54:22,043 WARN [ServiceController] jboss.jca:service=LocalTxDS,name=mssqldbdrun 09:54:22,043 INFO [JBossManagedConnectionPool] Creating
              09:54:22,043 INFO [JBossManagedConnectionPool] Created
              09:54:22,043 INFO [JBossManagedConnectionPool] Starting
              09:54:22,043 INFO [JBossManagedConnectionPool] Started
              09:54:22,043 INFO [MainDeployer] Deployed package: file:/C:/jboss-3.0.4/jboss-3
              .0.4/server/default/deploy/mssqldb-service.xml

              09:54:22,136 WARN [ServiceController] jboss.jca:service=LocalTxDS,name=mssqldbd
              s does not implement any Service methods
              09:54:22,136 INFO [LocalTxConnectionManager] Creating
              09:54:22,168 INFO [LocalTxConnectionManager] Created
              09:54:22,199 INFO [LocalTxConnectionManager] Starting
              09:54:22,214 INFO [JaasSecurityManagerService] Created securityMgr=org.jboss.se
              curity.plugins.JaasSecurityManager@13a34af
              09:54:22,214 INFO [JaasSecurityManagerService] setCachePolicy, c=org.jboss.util
              .TimedCachePolicy@58dd2d
              09:54:22,214 INFO [JaasSecurityManagerService] Added MSSQLDbRealm, org.jboss.se
              curity.plugins.SecurityDomainContext@20c906 to map
              09:54:22,246 INFO [mssqldbds] Bound connection factory for resource adapter 'JB
              oss LocalTransaction JDBC Wrapper' to JNDI name 'java:/mssqldbds'


              After getting this line , how should i look up from my EJB code .
              I have tried looking up using
              java:comp/env/java:/mssqldbds

              does not work. I still get null poointer exception and error that the name is not bound .
              plz look into it

              • 4. Re: SQL Server and JBOSS configuration
                muzairkhan Newbie

                Thanks for the help . i have solved the problem .

                Now there is only one problem remaining . i have to look up the data source using

                java:/ mssqldbds
                from my code . However , when i look up hssqldbDS i use
                java:comp/env etc to look up the data source

                Why is this .
                and how to adjust the setting so that i can look it up the same way as i do hssqldbDS