6 Replies Latest reply on Jan 8, 2004 10:41 AM by djeanprost

    MSSqlServer datasource configuration

    djeanprost

      Hello,


      I'm quite new to JBoss though I know well Weblogic.

      I'm trying to setup a DataSource with SQLServer. When starting, I get the following log entry
      14:34:06,831 INFO [MainDeployer] Starting deployment of package: file:/C:/bin/jboss/server/default/deploy/sofaxis-ds.xml
      14:34:07,182 INFO [RARDeployment] Started jboss.jca:service=ManagedConnectionFactory,name=sofaxis
      14:34:07,182 INFO [JBossManagedConnectionPool] Started jboss.jca:service=ManagedConnectionPool,name=sofaxis
      14:34:07,192 INFO [MainDeployer] Deployed package: file:/C:/bin/jboss/server/default/deploy/sofaxis-ds.xml

      but, I see no connection to my database.

      Here is my datasource configuration:

      <local-tx-datasource>
      <jndi-name>sofaxis</jndi-name>
      <connection-url>jdbc:inetdae7:orlwendolene?database=dexiasofaxis</connection-url>
      <driver-class>com.inet.tds.TdsDriver</driver-class>
      <user-name>sa</user-name>

      <check-valid-connection-sql>select 1 from systypes</check-valid-connection-sql>
      <new-connection-sql>select * from systypes</new-connection-sql>
      <connection-property name="prepare">false</connection-property>
      <connection-property name="appname">djp_jboss</connection-property>
      <min-pool-size>1</min-pool-size>
      <max-pool-size>5</max-pool-size>
      </local-tx-datasource>



      I tried to change user-name to foo and it doesn't anything more.

      Where am I wrong.

      Regards,
      Dom

        • 1. Re: MSSqlServer datasource configuration
          djeanprost

          in my config, I forgot to mention that I setup the user password :

          • 2. Re: MSSqlServer datasource configuration
            milowe

            Do you get an exception when you try to get a connection from the DataSource or whats the problem?

            • 3. Re: MSSqlServer datasource configuration
              darranl

              It is a while since I have looked at the initialisation of connection pools but I suspect that your connection will not be created until the first time it is actually requested.

              Your min-pol-size value will then just stop the connection pool size from dropping below 1.

              • 4. Re: MSSqlServer datasource configuration
                djeanprost

                 

                "darranl" wrote:
                It is a while since I have looked at the initialisation of connection pools but I suspect that your connection will not be created until the first time it is actually requested.

                Your min-pol-size value will then just stop the connection pool size from dropping below 1.


                Well, that is was I was about to test. I was just wondering if the connections would only be created after the first request.

                I have to say, this behaviour could be documented.

                Now I'm going to try to get a connection and use query to verify our assertion.

                thx.
                dom

                • 5. Re: MSSqlServer datasource configuration
                  djeanprost

                  When running the following code from netbeans,
                  Properties properties = new Properties();

                  properties.put(Context.INITIAL_CONTEXT_FACTORY, "org.jnp.interfaces.NamingContextFactory");
                  properties.put(Context.PROVIDER_URL, "jnp://ucdjp:1099");
                  Context initialContext = new InitialContext(properties);

                  DataSource ds = (DataSource)initialContext.lookup("java:/sofaxis");

                  I now get

                  javax.naming.NameNotFoundException: sofaxis not bound
                  at sun.rmi.transport.StreamRemoteCall.exceptionReceivedFromServer(StreamRemoteCall.java:247)
                  at sun.rmi.transport.StreamRemoteCall.executeCall(StreamRemoteCall.java:223)
                  at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:133)
                  at org.jnp.server.NamingServer_Stub.lookup(Unknown Source)
                  at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:528)
                  at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:507)
                  at javax.naming.InitialContext.lookup(InitialContext.java:347)
                  at test.TestJBoss.main(TestJBoss.java:40)


                  Maybe I make a mistake when looking for java:/sofaxis, or my datasource isn't well deployed

                  Can someone help me ?
                  regards,
                  dom

                  • 6. Re: MSSqlServer datasource configuration
                    djeanprost

                    Well, after a few post search, it seems JBoss doesn't allow to get a DataSource outside of its VM.

                    It's not easy to check if my DataSource is deployed.