4 Replies Latest reply on Jul 16, 2019 10:09 AM by xkb

    Connecting to a specific Sql Server database without access to master

    xkb

      Hello,

      I've installed jtds.jar all right.

      I've defined a connection to a specific database (user = dbo) of a specific instance.

      Sql Developer refuses to connect without an access to master.

      Since it would not let me list available db's (drop-down button in connection page) I exported/imported conn's via json, manually adding the database=mydatabase property to url (as I would in SSMS) but it won't work : SqlDev figures out the url parts but protests about not having access to master.

      Can you please confirm this is officially required ? (and if so : why ? since one can list tables and columns and lines values from SSMS and other shells without it, why put that restriction ?)

      Thanks

        • 1. Re: Connecting to a specific Sql Server database without access to master
          thatJeffSmith-Oracle

          I'm guessing that's not us but it's the jTDS driver.

           

          Are you trying to perform a SQL Server => Oracle migration?

          • 2. Re: Connecting to a specific Sql Server database without access to master
            xkb

            Hello Jeff, (wow, THE That Jeff ? )

            I understand your point.

            Not trying to migrate (for the moment), just trying to leverage the nicest features I know from SqlDev (self-service ad hoc reports, handier multi-tabs queries, etc.)

            Maybe some older jTDS driver won't be as privs greedy to connect ; I'll try that (thanks)

            I also try the editor's native driver but It won't apparently work with SqlDev connection window (no SqlServer choice in the drop-down list)

            Thanks anyhow

            I'll post here if I manage to work-it around.

            • 3. Re: Connecting to a specific Sql Server database without access to master
              xkb

              Hi Jeff,

               

              I've checked many older jtds drivers than 1.3.1 (0.9.1, 1.0.3, 1.1, 1.2.8) but it turned to be irrelevant :

               

              sqldeveloper-18.4.0-376.1900-no-jre works fine jtds with 1.3.1
              whereas
              sqldeveloper-19.1.0.094.2042-no-jre has that behavior :

               

              The server principal "my_user" is not able to access the database "master" under the current security context.
              Vendor code 916

               

              So I think release 19 came up with higher privs demands than release 18 (which is a pity but I then resolved to downgrade)

               

              I guess you'll want to figure out why and make those access optional.

               

              FYI : datamodeler-19.1.0.081.0911-no-jre works well with native editor's driver mssql-jdbc-7.2.2.jre8.jar and manages collecting sufficient metadata in order to reverse engineer db models without accessing master.

              • 4. Re: Connecting to a specific Sql Server database without access to master
                xkb

                Also, just for you know :

                 

                dbname parameter cannot be pulled out of the little drop-down list in the connection definition popup windows (apparently needing access to master)

                ...so I had to tweak it from a .json connections export file :

                 

                - I manually added the databasename propertie : "customUrl":"jdbc:jtds:sqlserver://mydbhost:1433/;databasename=mydbname"

                 

                ...and then reimported.