Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    Database connection

    hello
    I can,t creat new database connection for MsSQLServer .
    I installed the right driver and creat CLASSPATH variable . but after I created new connection and want to test ,it return this error "Error from driver : java.lang.ClassNotFounfException : com.microsoft.jdbc.sqlserver.SQLServerDriver"

    #2
    Hi Mehdi,

    We suggest trying to access SQLServer through a standalone Java application first in order to ensure everything is installed correctly, as that does not appear to be a SmartClient-specific error. There are many tutorials on how to do this.

    Comment


      #3
      sql server connection

      Mehdi,

      Copy the sqljdbc.jar file to the smartClientRuntime\WEB-INF\lib directory and then restart the tomcat server.

      You should then be able to connect. That's how I was able to resolve it. Not sure if it's the correct way or not, but it works for me.

      Hope this helps.

      Comment


        #4
        Error in admin console string is confusing

        The correct driver name is

        com.microsoft.sqlserver.jdbc.SQLServerDriver

        which is not the one that defaults in the Admin Console. It's got bits permuted.

        I just set it up with a VMWare machine running a SQL database and am using the connection string:

        jdbc:sqlserver://192.168.146.136:1433;databaseName=ReportServer;integratedSecurity=false;user=test;password=test

        In summary, get the driver from microsoft, copy the jar file into the SDK WEB-INF/lib folder, and use the right driver name above.

        Comment


          #5
          Thanks for clearing that up at last.

          .. but hang on, the mystery may not be completely solved. A Google search for "com.microsoft.jdbc.sqlserver.SQLServerDriver" (the Admin Console default) yields 68,300 hits. A search for "com.microsoft.sqlserver.jdbc.SQLServerDriver" (the setting that works for you) yields 33,700 hits.

          Could it be possible that both.. Oh my. Yes, Microsoft switched the classname of the driver between SQL Server 2000 and SQL Server 2005.

          The upshot is:

          1. Make sure you have the right JDBC driver, they differ between SQL Server 2000 and SQL Server 2005.

          2. With the SQL Server 2005 driver, use com.microsoft.sqlserver.jdbc.SQLServerDriver as the driver classname, and prefix the connection URL "jdbc:sqlserver://"

          3. With the SQL Server 2000 driver, use com.microsoft.jdbc.sqlserver.SQLServerDriver and a URL prefix of "jdbc:microsoft:sqlserver://"

          We'll switch the Admin Console default to the right value for SQL Server 2005.
          Last edited by Isomorphic; 22 Apr 2011, 08:44. Reason: Also mention change in URL prefix, since this post is linked to as a solution

          Comment


            #6
            Driver not installed. SQLSERVER 2005

            Hi, isomorphic.
            I've copied sqljdbc.jar to [webroot]/WEB-INF/lib, and the message remain the same.

            I've got the correct jar, 'cause I've got from another framework (DBartisan) installation. The jar to SQLSERVER on this framework work, in fact I've defined connections that connect to remote SQLSERVER 2005 and they are working.

            In addition I tested this jar in Sun App. Server, making pooling, and it worked.

            is there another clue that I must to know?.

            Thanks.
            Last edited by cavogadr; 15 Dec 2008, 06:45.

            Comment


              #7
              In the Admin Console (also known as the "Databases" tab in the Developer Console) are you using the correct DriverName? See the posts above.

              Comment


                #8
                Originally posted by Isomorphic
                In the Admin Console (also known as the "Databases" tab in the Developer Console) are you using the correct DriverName? See the posts above.
                Yes I'm do it. But don't worry about.

                I've another question. I've read something about it, but I searched it, but I couldn't got it. It's about to show datasource in the admin console. I created a datasource, only the ds.xml file, it connected to oracle, oracle is available and it's default db, but I not see my datasource. Why?.
                The file parts.ds.xml is located on webroot/examples/shared/ds.

                As always, thanks.

                Comment


                  #9
                  In the Admin Console there are two tabs, "Data Configuration" and "Import DataSources". If your DataSource is in [webroot]/shared/ds and is working (can be loaded with an isomorphic:loadDS JSP tag) it will appear in the Import DataSources tab. If it's not there, click the "Refresh" button.

                  Comment


                    #10
                    Originally posted by Isomorphic
                    In the Admin Console there are two tabs, "Data Configuration" and "Import DataSources". If your DataSource is in [webroot]/shared/ds and is working (can be loaded with an isomorphic:loadDS JSP tag) it will appear in the Import DataSources tab. If it's not there, click the "Refresh" button.
                    The file parts.ds.xml is there for every shared/ds path and it's not appear. Another clue?.
                    In addition, when I change the name of same ds.xml in the [webroot]/shared/ds, it disappear from admin console. Why?. And then, rename to default name, it's showing again. How does it work?.

                    In my enviroment the [webroot]/shared/ds path correspond to /examples/shared/ds, that's ok?.

                    I've installed the Evaluation and Runtime version package.

                    Thanks.
                    Last edited by cavogadr; 17 Dec 2008, 13:20.

                    Comment


                      #11
                      This isn't making much sense. You just said you can't get the DataSource to appear in the admin console, but somehow you can get it to appear or not appear by changing it's name..? Does it appear or doesn't it?

                      The mechanism is extremely simple. In WEB-INF/classes/server.properties there is a project.dataSources property that configures the path where you put DataSources. For a DataSource with ID "blah", name the file blah.ds.xml. Be sure you hit "refresh" or reload the Admin Console after adding a DataSource. That's it.

                      Comment


                        #12
                        Database Connection.

                        Originally posted by Isomorphic
                        This isn't making much sense. You just said you can't get the DataSource to appear in the admin console, but somehow you can get it to appear or not appear by changing it's name..? Does it appear or doesn't it?

                        The mechanism is extremely simple. In WEB-INF/classes/server.properties there is a project.dataSources property that configures the path where you put DataSources. For a DataSource with ID "blah", name the file blah.ds.xml. Be sure you hit "refresh" or reload the Admin Console after adding a DataSource. That's it.
                        Excuse me, I forgot to post that I already understood the mechanism for the ds.
                        I'm thankful for you posted me.
                        Charlie

                        Comment


                          #13
                          Hi Charlie.. so.. are you all set then?

                          Comment

                          Working...
                          X