# JDBC connection to azure sqlserver db

**URL:** <https://community.stardog.com/t/jdbc-connection-to-azure-sqlserver-db/4470>\
**Category:** Support\
**Created:** [July 11, 2023, 7:50am UTC](https://community.stardog.com/t/jdbc-connection-to-azure-sqlserver-db/4470 "2023-07-11T07:50:02Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Viji\_G](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.stardog.com/viji_g/32/1846_2.png) [@Viji\_G](https://community.stardog.com/u/Viji_G)\
**Post date:** [July 11, 2023, 7:50am UTC](https://community.stardog.com/t/jdbc-connection-to-azure-sqlserver-db/4470/1 "2023-07-11T07:50:02Z")

</div>

JDBC connection to the database was successful. unable to get the list of tables available in the source DB under resource scope. Can you please help?

 ![image](https://canada1.discourse-cdn.com/flex030/uploads/stardog/original/2X/1/12497d9be9476a41ac320efce481b782827f4f32.png)

---

<div class="post-metadata">

**Author:** ![PaulJackson](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.stardog.com/pauljackson/32/243_2.png) [@PaulJackson](https://community.stardog.com/u/PaulJackson)\
**Post date:** [July 11, 2023, 2:49pm UTC](https://community.stardog.com/t/jdbc-connection-to-azure-sqlserver-db/4470/2 "2023-07-11T14:49:04Z")

</div>

Hi Viji,

Welcome to the community.

When you received this error, were you creating a new datasource or did you click on an existing one? If it was an existing one, what UI did you use to create it (Designer, Studio, CLI)?

In what database do you expect to find tables?

Does the datasource include the `databaseName=<yourcatalog>` property in the JDBC connection string?

Did you add (or did the existing data source have) the `sql.default.schema` or `sql.schemas` data source options?

-Paul

---

<div class="post-metadata">

**Author:** ![Viji\_G](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.stardog.com/viji_g/32/1846_2.png) [@Viji\_G](https://community.stardog.com/u/Viji_G)\
**Post date:** [July 12, 2023, 6:25am UTC](https://community.stardog.com/t/jdbc-connection-to-azure-sqlserver-db/4470/3 "2023-07-12T06:25:31Z")

</div>

Hi Paul,

I was creating a new datasource

I expect to find the tables from Azure SQLserver DB. I took the jdbc connection string from azure portal.

Does the datasource include the `databaseName=<yourcatalog>` property in the JDBC connection string?  
yes. below is the connection string I used. I tried to replace database to databaseName, the connection was successful.

jdbc:sqlserver://{servername}:{port};database={db Name};user={username@dbname};password={your\_password\_here};encrypt=true;trustServerCertificate=false;hostNameInCertificate=\*.database.windows.net;loginTimeout=30;

Tables are not loaded in the default schema. I used to query the data by schemaname.table name from sqlserver management studio.

---

<div class="post-metadata">

**Author:** ![PaulJackson](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.stardog.com/pauljackson/32/243_2.png) [@PaulJackson](https://community.stardog.com/u/PaulJackson)\
**Post date:** [July 12, 2023, 2:03pm UTC](https://community.stardog.com/t/jdbc-connection-to-azure-sqlserver-db/4470/4 "2023-07-12T14:03:53Z")

</div>

In my testing just now, I have a MS SQL Server with databases (aka catalogs) `catalog1` and `catalog2`.

I use the connection string:  
`dbc:sqlserver://mssql.myserverid.us-east-1.rds.amazonaws.com:1433;databaseName=catalog1;trustServerCertificate=true`

And I set `sql.schemas=catalog2.dbo`.

Stardog picks up `catalog1` from the connection string and `catalog2` from the `sql.schemas` property.

From there I see tables from both DBs (`catalog1.table1`, `catalog2.table2`, etc).

It's possible I'm seeing something different because I'm using a traditional SQL Server instance rather than the Azure-hosted version. Let me know if the configuration above doesn't help and I can look into finding an Azure instance.

-Paul

---

<div class="post-metadata">

**Author:** ![Viji\_G](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.stardog.com/viji_g/32/1846_2.png) [@Viji\_G](https://community.stardog.com/u/Viji_G)\
**Post date:** [July 12, 2023, 2:46pm UTC](https://community.stardog.com/t/jdbc-connection-to-azure-sqlserver-db/4470/5 "2023-07-12T14:46:45Z")

</div>

> [@PaulJackson](#):
>
> t's possible I'm seeing something different because I'm using a traditional SQL Server instance rather than the Azure-hosted version. Let me know if the configuration above doesn't help and I can look into finding an Azure instance.

Hi Paul, thanks for the inputs. i updated sql.schemas from stardog studio. Now im able to query the tables. Thanks very much.
